Commit 72292421 authored by Sergey Glukhov's avatar Sergey Glukhov

Bug#42758 INFORMATION_SCHEMA.COLUMNS is inconsistent

remove 'unsigned', 'zerofill' attributes
from DATA_TYPE column value.
parent ea54709f
......@@ -3797,7 +3797,18 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables,
table->field[4]->store((longlong) count, TRUE);
field->sql_type(type);
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