summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorholyfoot/hf@hfmain.(none) <>2007-06-14 16:35:20 +0500
committerholyfoot/hf@hfmain.(none) <>2007-06-14 16:35:20 +0500
commit76e0a0768a66684f82923c7ddb2cfcac8b3e782f (patch)
treeeb0a6d3ab2139653b88ab2a0f4a0d70e79a24f63 /sql
parent2372767bbdbc67390e388b7af7fc2bb2e94822ac (diff)
parent20ad51500325027dcf629867c053ce0efeb5a81e (diff)
downloadmariadb-git-76e0a0768a66684f82923c7ddb2cfcac8b3e782f.tar.gz
Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
Diffstat (limited to 'sql')
-rw-r--r--sql/item_func.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 70859aeb457..fb2f361f676 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -1954,7 +1954,13 @@ void Item_func_round::fix_length_and_dec()
{
max_length= args[0]->max_length;
decimals= args[0]->decimals;
- hybrid_type= REAL_RESULT;
+ if (args[0]->result_type() == DECIMAL_RESULT)
+ {
+ max_length++;
+ hybrid_type= DECIMAL_RESULT;
+ }
+ else
+ hybrid_type= REAL_RESULT;
return;
}