mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Patch for WL#3736: Extended Table, Column and Index Comments.
The task is to (a) add a comment on indexes and (b) increase the maximum length of column, table and the new index comments. The patch committed on behalf of Yoshinori Matsunobu (Yoshinori.Matsunobu@Sun.COM).
This commit is contained in:
@ -1375,7 +1375,6 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
|
||||
end= longlong10_to_str(create_info.auto_increment_value, buff,10);
|
||||
packet->append(buff, (uint) (end - buff));
|
||||
}
|
||||
|
||||
|
||||
if (share->table_charset &&
|
||||
!(thd->variables.sql_mode & MODE_MYSQL323) &&
|
||||
@ -1520,6 +1519,14 @@ static void store_key_options(THD *thd, String *packet, TABLE *table,
|
||||
end= longlong10_to_str(key_info->block_size, buff, 10);
|
||||
packet->append(buff, (uint) (end - buff));
|
||||
}
|
||||
DBUG_ASSERT(test(key_info->flags & HA_USES_COMMENT) ==
|
||||
(key_info->comment.length > 0));
|
||||
if (key_info->flags & HA_USES_COMMENT)
|
||||
{
|
||||
packet->append(STRING_WITH_LEN(" COMMENT "));
|
||||
append_unescaped(packet, key_info->comment.str,
|
||||
key_info->comment.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4767,6 +4774,11 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
|
||||
else
|
||||
table->field[14]->store("", 0, cs);
|
||||
table->field[14]->set_notnull();
|
||||
DBUG_ASSERT(test(key_info->flags & HA_USES_COMMENT) ==
|
||||
(key_info->comment.length > 0));
|
||||
if (key_info->flags & HA_USES_COMMENT)
|
||||
table->field[15]->store(key_info->comment.str,
|
||||
key_info->comment.length, cs);
|
||||
if (schema_table_store_record(thd, table))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
@ -6725,7 +6737,8 @@ ST_FIELD_INFO tables_fields_info[]=
|
||||
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), "Checksum", OPEN_FULL_TABLE},
|
||||
{"CREATE_OPTIONS", 255, MYSQL_TYPE_STRING, 0, 1, "Create_options",
|
||||
OPEN_FRM_ONLY},
|
||||
{"TABLE_COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", OPEN_FRM_ONLY},
|
||||
{"TABLE_COMMENT", TABLE_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
|
||||
"Comment", OPEN_FRM_ONLY},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
|
||||
};
|
||||
|
||||
@ -6759,7 +6772,8 @@ ST_FIELD_INFO columns_fields_info[]=
|
||||
{"COLUMN_KEY", 3, MYSQL_TYPE_STRING, 0, 0, "Key", OPEN_FRM_ONLY},
|
||||
{"EXTRA", 27, MYSQL_TYPE_STRING, 0, 0, "Extra", OPEN_FRM_ONLY},
|
||||
{"PRIVILEGES", 80, MYSQL_TYPE_STRING, 0, 0, "Privileges", OPEN_FRM_ONLY},
|
||||
{"COLUMN_COMMENT", 255, MYSQL_TYPE_STRING, 0, 0, "Comment", OPEN_FRM_ONLY},
|
||||
{"COLUMN_COMMENT", COLUMN_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
|
||||
"Comment", OPEN_FRM_ONLY},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
|
||||
};
|
||||
|
||||
@ -6917,6 +6931,8 @@ ST_FIELD_INFO stat_fields_info[]=
|
||||
{"NULLABLE", 3, MYSQL_TYPE_STRING, 0, 0, "Null", OPEN_FRM_ONLY},
|
||||
{"INDEX_TYPE", 16, MYSQL_TYPE_STRING, 0, 0, "Index_type", OPEN_FULL_TABLE},
|
||||
{"COMMENT", 16, MYSQL_TYPE_STRING, 0, 1, "Comment", OPEN_FRM_ONLY},
|
||||
{"INDEX_COMMENT", INDEX_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0,
|
||||
"Index_comment", OPEN_FRM_ONLY},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user