Commit 326de495 authored by Sergey Glukhov's avatar Sergey Glukhov

Bug#42758 INFORMATION_SCHEMA.COLUMNS is inconsistent

remove 'unsigned', 'zerofill' attributes
from DATA_TYPE column value.


mysql-test/suite/funcs_1/r/is_columns_innodb.result:
  result fix
mysql-test/suite/funcs_1/r/is_columns_memory.result:
  result fix
mysql-test/suite/funcs_1/r/is_columns_myisam.result:
  result fix
sql/sql_show.cc:
  remove 'unsigned', 'zerofill' attributes 
  from DATA_TYPE column value.
parent f08d47b4
......@@ -3796,8 +3796,19 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
cs);
table->field[4]->store((longlong) count, TRUE);
field->sql_type(type);
table->field[14]->store(type.ptr(), type.length(), cs);
table->field[14]->store(type.ptr(), type.length(), cs);
/*
MySQL column type has the following format:
base_type [(dimension)] [unsigned] [zerofill].
For DATA_TYPE column we extract only base type.
*/
tmp_buff= strchr(type.ptr(), '(');
if (!tmp_buff)
/*
if there is no dimention part then check the presence of
[unsigned] [zerofill] attributes and cut them of if exist.
*/
tmp_buff= strchr(type.ptr(), ' ');
table->field[7]->store(type.ptr(),
(tmp_buff ? tmp_buff - type.ptr() :
type.length()), cs);
......
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