summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <hf@eagle.intranet.mysql.r18.ru>2006-01-21 18:50:06 +0400
committerunknown <hf@eagle.intranet.mysql.r18.ru>2006-01-21 18:50:06 +0400
commit494bccf044edd91363bf4b296dbc0cbbdc4e4bf9 (patch)
treeba57b634fbff540434a56e3ce0639c85ec0f82ea /sql/item_func.cc
parentff3079c8d0f27a54b55cb2685aa9fd1cb498bc1a (diff)
parentffe11393c9ce64a064faa2b85d3fb78de9adc013 (diff)
downloadmariadb-git-494bccf044edd91363bf4b296dbc0cbbdc4e4bf9.tar.gz
Merging
mysql-test/ndb/ndbcluster.sh: Auto merged mysql-test/r/func_gconcat.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/t/func_math.test: Auto merged mysql-test/t/type_float.test: Auto merged sql/spatial.h: Auto merged mysql-test/r/type_float.result: merging sql/item_func.cc: merging
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 428a796682c..2d595e5fdc8 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -429,12 +429,19 @@ my_decimal *Item_real_func::val_decimal(my_decimal *decimal_value)
void Item_func::fix_num_length_and_dec()
{
- decimals= 0;
+ uint fl_length= 0;
+ decimals=0;
for (uint i=0 ; i < arg_count ; i++)
{
- set_if_bigger(decimals, args[i]->decimals);
+ 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);
}
- max_length= float_length(decimals);
}