summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-09-27 15:31:38 +0500
committerunknown <hf@deer.(none)>2005-09-27 15:31:38 +0500
commit57e700d7d790f97663044d32aac0102c501f3052 (patch)
treedd1d2fb1f4bc39851040af4e163af9919c478b62 /sql
parent087f7cc82adf16138f701cede7d295778db06681 (diff)
downloadmariadb-git-57e700d7d790f97663044d32aac0102c501f3052.tar.gz
additional fix to the bug #13372 (decimal union)
mysql-test/r/type_float.result: test result fixed sql/item.cc: we have to limit the max_length
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc
index ec83cc1f511..b3c0e64dec1 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -3230,12 +3230,12 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
}
case REAL_RESULT:
{
- decimals= max(decimals, item->decimals);
if (decimals != NOT_FIXED_DEC)
{
int delta1= max_length_orig - decimals_orig;
int delta2= item->max_length - item->decimals;
- max_length= max(delta1, delta2) + decimals;
+ max_length= min(max(delta1, delta2) + decimals,
+ (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7);
}
else
max_length= (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7;