Bug #81642 | union of decimal(10,1) and decimal(10,9) is not expected decimal(18,9) | ||
---|---|---|---|
Submitted: | 30 May 2016 11:26 | Modified: | 30 May 2016 16:02 |
Reporter: | Su Dylan | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 5.7.8 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[30 May 2016 11:26]
Su Dylan
[30 May 2016 14:27]
MySQL Verification Team
Hello Mr (or Ms) Dylan, What text in our user manual gave you the impression that resulting type of the CASTED floating number should be decimal (18,9). Casted IEEE floating number types will behave (in this case) as decimals, as much as possible. However, you should not forget that you are dealing with a floating point type and not decimal type, regardless of the casting. Have you tried the same operation with decimal types ???
[30 May 2016 15:02]
Su Dylan
Hi Sinisa, Thanks for your feedback. I made it really hard to understand. Sorry for that. Let me clarify it. For "select d from t2 union select * from t1", I mean double(18,9), not decimal(18,9). I may have some misunderstanding. Then what should the result type for "select d from t2 union select * from t1" be? Thanks:)
[30 May 2016 16:02]
MySQL Verification Team
Hi, The output for that UNION should be: "select d from t2 union select * from t1" +-----------+ | d | +-----------+ | 1.2345678 | | 100000000 | +-----------+ If you have read our manual, you would have read that in the declaration of REAL or DOUBLE (M,N), total number of digits and number of digits in the fractional part, are only INFORMATIVE and are not using in formatting the output. Hence, not a bug.