Bug #50293 | Difference in SELECT output when search is based on an invalid DATE/DATETIME | ||
---|---|---|---|
Submitted: | 12 Jan 2010 22:23 | Modified: | 14 Jan 2010 23:41 |
Reporter: | Nirbhay Choubey | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 5.1-bugteam, 5.5.99 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[12 Jan 2010 22:23]
Nirbhay Choubey
[13 Jan 2010 6:35]
Sveta Smirnova
Thank you for the report. Verified as described.
[14 Jan 2010 23:41]
Omer Barnir
This change is expected and is part of recent fixes. MySQL converts invalid dates to '0000-00-00 00:00:00' and then interprets them so the invalid value inserted was inserted as '0000-00-00 00:00:00' and the invalid value in the where clause was converted to '0000-00-00 00:00:00' so they match. The same happens for integer columns. If you try to insert 'abc' it will be inserted as zero and if you then query for WHERE col='string' the zero rows will be returned.