diff options
author | hf@deer.(none) <> | 2005-10-15 19:47:23 +0500 |
---|---|---|
committer | hf@deer.(none) <> | 2005-10-15 19:47:23 +0500 |
commit | ba82a6a759643d287810f814ad2f7b7f54c71e5f (patch) | |
tree | 3ca8d51a0ca8d764972dc920ebe2e5c1d608d6aa /sql/item_func.cc | |
parent | b709578f1f5486aa6068363ad7795b908c743b05 (diff) | |
download | mariadb-git-ba82a6a759643d287810f814ad2f7b7f54c71e5f.tar.gz |
Fix for bug #9855 (Inconsistend column type in create select)
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 288859443ff..019147e151f 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -359,10 +359,19 @@ String *Item_num_func::val_str(String *str) void Item_func::fix_num_length_and_dec() { + uint fl_length= 0; decimals=0; for (uint i=0 ; i < arg_count ; i++) + { set_if_bigger(decimals,args[i]->decimals); + set_if_bigger(fl_length, args[i]->max_length); + } max_length=float_length(decimals); + if (fl_length > max_length) + { + decimals= NOT_FIXED_DEC; + max_length= float_length(NOT_FIXED_DEC); + } } Item *Item_func::get_tmp_table_item(THD *thd) |