Bug #1833 | NULL values in SELECTs within UNIONs cause incorrect values from other SELECTs | ||
---|---|---|---|
Submitted: | 13 Nov 2003 19:53 | Modified: | 14 Nov 2003 10:36 |
Reporter: | Paul Coldrey | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S2 (Serious) |
Version: | 4.0.16 | OS: | Windows (Windows XP Pro) |
Assigned to: | CPU Architecture: | Any |
[13 Nov 2003 19:53]
Paul Coldrey
[13 Nov 2003 21:08]
Paul Coldrey
I also just discovered that if you type: SELECT Value, 'a' as V2 FROM Data WHERE Value = 1 UNION SELECT Value, 'ab' as V2 FROM Data WHERE Value = 2; you get: Value | V2 ----------------- 1 | a 2 | a Rather than Value | V2 ----------------- 1 | a 2 | ab Also, notable is that if the second select contained a date value in a column where the first select has 'a', then the date field would be trimming to 1 character wide. If the first select has 'ab' you'd get the first two characters of the date.
[14 Nov 2003 10:36]
Dean Ellis
This is a duplicate of issue #96. Issue is caused by MySQL's handling of literal values and is slated to be changed in a future release. Thank you.