summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2010-12-24 14:21:44 +0300
committerSergey Glukhov <sergey.glukhov@oracle.com>2010-12-24 14:21:44 +0300
commit0a1433d7b0aa2c2d38169922817ab5010ec8e399 (patch)
tree82546965b04b0be2be698ebfd4496241ce173339 /sql
parent283630356c9e19522df99b8fe728adcfa426703d (diff)
parentbc56dcea9d7047c5561cee08ec2d74077e329f7d (diff)
downloadmariadb-git-0a1433d7b0aa2c2d38169922817ab5010ec8e399.tar.gz
5.1-bugteam->5.5-bugteam merge
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index ecc4f30e25d..c8e21ce5bf7 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1543,9 +1543,14 @@ void Item_func_div::fix_length_and_dec()
{
decimals=max(args[0]->decimals,args[1]->decimals)+prec_increment;
set_if_smaller(decimals, NOT_FIXED_DEC);
- max_length=args[0]->max_length - args[0]->decimals + decimals;
uint tmp=float_length(decimals);
- set_if_smaller(max_length,tmp);
+ if (decimals == NOT_FIXED_DEC)
+ max_length= tmp;
+ else
+ {
+ max_length=args[0]->max_length - args[0]->decimals + decimals;
+ set_if_smaller(max_length,tmp);
+ }
break;
}
case INT_RESULT: