Bug #35818 | union not checking for unsigned vs signed, returns 0's | ||
---|---|---|---|
Submitted: | 3 Apr 2008 22:11 | Modified: | 4 Apr 2008 5:48 |
Reporter: | Ariel S | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | Ver 14.12 Distrib 5.0.32, 5.0.56 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | signed, UNION, UNSIGNED |
[3 Apr 2008 22:11]
Ariel S
[3 Apr 2008 22:13]
Ariel S
The last query should be: (select c from test) union (select c from test2); Not: (select c from test) union (select -c from test2);
[4 Apr 2008 5:48]
Valeriy Kravchuk
Thank you for a problem report. According to the manual, http://dev.mysql.com/doc/refman/5.0/en/union.html: "If the data types of corresponding SELECT columns do not match, the types and lengths of the columns in the UNION result take into account the values retrieved by all of the SELECT statements." The above, "taking into account types of the columns ... retrieved by all of the SELECT statements", should be applied to UNSIGNED flag also.
[4 Apr 2013 8:34]
Hartmut Holzgraefe
Still verifiable in 5.6.10