Commit a6793a48 authored by Michael Widenius's avatar Michael Widenius

Fixed problem with schema tables and DECIMAL


sql/sql_show.cc:
  Change decimal item to type holder, to be able to define the decimals and max_length for the DECIMAL
  field from the schema specification instead of the value of the item.
parent 51186f1d
...@@ -5608,6 +5608,12 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) ...@@ -5608,6 +5608,12 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
{ {
DBUG_RETURN(0); DBUG_RETURN(0);
} }
/*
Create a type holder, as we want the type of the item to defined
the type of the object, not the value
*/
if (!(item= new Item_type_holder(thd, item)))
DBUG_RETURN(0);
item->unsigned_flag= (fields_info->field_flags & MY_I_S_UNSIGNED); item->unsigned_flag= (fields_info->field_flags & MY_I_S_UNSIGNED);
item->decimals= fields_info->field_length%10; item->decimals= fields_info->field_length%10;
item->max_length= (fields_info->field_length/100)%100; item->max_length= (fields_info->field_length/100)%100;
......
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