From a6793a48e20c2aebb1391e2f4f916cf147ff1900 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Mon, 2 Nov 2009 11:30:21 +0200 Subject: [PATCH] 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. --- sql/sql_show.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bd9e1fb5c72..0601aa976b8 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5608,6 +5608,12 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) { 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->decimals= fields_info->field_length%10; item->max_length= (fields_info->field_length/100)%100;