diff options
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 53ea77db0c8..bf4909e1846 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1854,8 +1854,11 @@ my_decimal *Item_func_mod::decimal_op(my_decimal *decimal_value) void Item_func_mod::result_precision() { + unsigned_flag= args[0]->unsigned_flag; decimals= MY_MAX(args[0]->decimal_scale(), args[1]->decimal_scale()); - max_length= MY_MAX(args[0]->max_length, args[1]->max_length); + uint prec= MY_MAX(args[0]->decimal_precision(), args[1]->decimal_precision()); + fix_char_length(my_decimal_precision_to_length_no_truncation(prec, decimals, + unsigned_flag)); } |