Commit 5f17cbab authored by bar@mysql.com's avatar bar@mysql.com

sql_show.cc:

  after-merge fix for
  bug#15581 COALESCE function truncates mutli-byte TINYTEXT values
parent 832148de
......@@ -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();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment