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

sql_show.cc:

after-merge fix for
  bug#15581 COALESCE function truncates mutli-byte TINYTEXT values
This commit is contained in:
bar@mysql.com
2006-01-12 16:05:46 +04:00
parent 832148ded2
commit 5f17cbaba4

View File

@ -2623,12 +2623,15 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
field->real_type() == MYSQL_TYPE_VARCHAR || // For varbinary type
field->real_type() == MYSQL_TYPE_STRING) // For binary type
{
uint32 octet_max_length= field->max_length();
if (octet_max_length != (uint32) 4294967295U)
octet_max_length /= field->charset()->mbmaxlen;
longlong char_max_len= is_blob ?
(longlong) field->max_length() / field->charset()->mbminlen :
(longlong) field->max_length() / field->charset()->mbmaxlen;
(longlong) octet_max_length / field->charset()->mbminlen :
(longlong) octet_max_length / field->charset()->mbmaxlen;
table->field[8]->store(char_max_len, TRUE);
table->field[8]->set_notnull();
table->field[9]->store((longlong) field->max_length(), TRUE);
table->field[9]->store((longlong) octet_max_length, TRUE);
table->field[9]->set_notnull();
}