1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for bug#13934 Silent truncation of table comments

Table comment: issue a warning(error in traditional mode) if length of comment > 60 symbols
Column comment: issue a warning(error in traditional mode) if length of comment > 255 symbols
Table 'comment' is changed from char* to LEX_STRING
This commit is contained in:
gluh@eagle.intranet.mysql.r18.ru
2006-06-29 18:39:34 +05:00
parent f9214221fc
commit a230166f28
9 changed files with 150 additions and 15 deletions

View File

@ -1080,10 +1080,10 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
packet->append(ha_row_type[(uint) share->row_type]);
}
table->file->append_create_info(packet);
if (share->comment && share->comment[0])
if (share->comment.length)
{
packet->append(STRING_WITH_LEN(" COMMENT="));
append_unescaped(packet, share->comment, strlen(share->comment));
append_unescaped(packet, share->comment.str, share->comment.length);
}
if (share->connect_string.length)
{
@ -2547,11 +2547,14 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
(uint) (ptr-option_buff)-1), cs);
{
char *comment;
comment= show_table->file->update_table_comment(share->comment);
comment= show_table->file->update_table_comment(share->comment.str);
if (comment)
{
table->field[20]->store(comment, strlen(comment), cs);
if (comment != share->comment)
table->field[20]->store(comment,
(comment == share->comment.str ?
share->comment.length :
strlen(comment)), cs);
if (comment != share->comment.str)
my_free(comment, MYF(0));
}
}