summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-05-11 12:19:37 +0200
committerunknown <serg@serg.mylan>2004-05-11 12:19:37 +0200
commit76bc67711723bfa0eeda33798c706d9e333bbb30 (patch)
treea1714a23c4ab0a10dccf1dfc7509b53b00ebb03d /sql/item_func.cc
parent2b4a56b9f32d794f54b169d90d422d143320cfd7 (diff)
downloadmariadb-git-76bc67711723bfa0eeda33798c706d9e333bbb30.tar.gz
bug#3612 - Item_func_div set decimals incorrectly
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 9d1f784fc25..368c14cc8df 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -402,6 +402,7 @@ longlong Item_func_div::val_int()
void Item_func_div::fix_length_and_dec()
{
decimals=max(args[0]->decimals,args[1]->decimals)+2;
+ 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);