diff --git a/sql/item.h b/sql/item.h index 7eea60e8213..e5a3215d13e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3622,10 +3622,10 @@ class Item_return_date_time :public Item_partition_func_safe_string enum_field_types date_time_field_type; public: Item_return_date_time(THD *thd, const char *name_arg, uint length_arg, - enum_field_types field_type_arg): + enum_field_types field_type_arg, uint dec_arg= 0): Item_partition_func_safe_string(thd, name_arg, length_arg, &my_charset_bin), date_time_field_type(field_type_arg) - { decimals= 0; } + { decimals= dec_arg; } enum_field_types field_type() const { return date_time_field_type; } }; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e3613c1e0e7..084e98b143f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7730,7 +7730,8 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) if (!(item=new (mem_root) Item_return_date_time(thd, fields_info->field_name, strlen(fields_info->field_name), - fields_info->field_type))) + fields_info->field_type, + fields_info->field_length))) DBUG_RETURN(0); item->decimals= fields_info->field_length; break;