diff options
author | Alexey Kopytov <Alexey.Kopytov@sun.com> | 2009-03-27 13:12:50 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@sun.com> | 2009-03-27 13:12:50 +0300 |
commit | afb2b6de68084b7aa5daa05cfc8ccac9fdeabf5d (patch) | |
tree | 25ffdefedc9a553afb5467a7752e34c85a3abbf9 /sql/mysql_priv.h | |
parent | 8725bcd94402800ac2d87f94dfecd5a202d80497 (diff) | |
download | mariadb-git-afb2b6de68084b7aa5daa05cfc8ccac9fdeabf5d.tar.gz |
Fix for bug #43432: Union on floats does unnecessary rounding
UNION could convert fixed-point FLOAT(M,D)/DOUBLE(M,D) columns
to FLOAT/DOUBLE when aggregating data types from the SELECT
substatements. While there is nothing particularly wrong with
this behavior, especially when M is greater than the hardware
precision limits, it could be confusing in cases when all
SELECT statements in a union have the same
FLOAT(M,D)/DOUBLE(M,D) columns with equal precision
specifications listed in the same position.
Since the manual is quite vague on what data type should be
returned in such cases, the bug was fixed by implementing the
most 'expected' behavior: do not convert FLOAT(M,D)/DOUBLE(M,D)
to anything else if all SELECT statements in a UNION have the
same precision for that column.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b855af9a8d3..58ab7a08837 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -251,6 +251,11 @@ MY_LOCALE *my_locale_by_number(uint number); #define PRECISION_FOR_DOUBLE 53 #define PRECISION_FOR_FLOAT 24 +/* -[digits].E+## */ +#define MAX_FLOAT_STR_LENGTH (FLT_DIG + 6) +/* -[digits].E+### */ +#define MAX_DOUBLE_STR_LENGTH (DBL_DIG + 7) + /* Default time to wait before aborting a new client connection that does not respond to "initial server greeting" timely |