mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
sql_show.cc:
after-merge fix for bug#15581 COALESCE function truncates mutli-byte TINYTEXT values
This commit is contained in:
@ -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_VARCHAR || // For varbinary type
|
||||||
field->real_type() == MYSQL_TYPE_STRING) // For binary 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 char_max_len= is_blob ?
|
||||||
(longlong) field->max_length() / field->charset()->mbminlen :
|
(longlong) octet_max_length / field->charset()->mbminlen :
|
||||||
(longlong) field->max_length() / field->charset()->mbmaxlen;
|
(longlong) octet_max_length / field->charset()->mbmaxlen;
|
||||||
table->field[8]->store(char_max_len, TRUE);
|
table->field[8]->store(char_max_len, TRUE);
|
||||||
table->field[8]->set_notnull();
|
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();
|
table->field[9]->set_notnull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user