Bug #32291 | SELECT query returns empty result when datetime field contains nulls | ||
---|---|---|---|
Submitted: | 12 Nov 2007 18:29 | Modified: | 12 Nov 2007 18:48 |
Reporter: | Maciej Tomaka | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: General | Severity: | S2 (Serious) |
Version: | 5.0.45 | OS: | Linux (tested on Ubuntu 6.06 and rhel 5) |
Assigned to: | CPU Architecture: | Any | |
Tags: | date, datetime, null, SELECT |
[12 Nov 2007 18:29]
Maciej Tomaka
[12 Nov 2007 18:32]
Maciej Tomaka
Tested on engines InnoDB and MyIsam.
[12 Nov 2007 18:48]
MySQL Verification Team
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at http://dev.mysql.com/doc/en/installing-source.html [miguel@skybr 5.0]$ bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.52-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> SELECT * FROM tmp where DATE(time) = '2007-11-12'; +---------------------+ | time | +---------------------+ | 2007-11-12 15:11:22 | +---------------------+ 1 row in set (0.00 sec) mysql> SELECT * FROM tmp; +---------------------+ | time | +---------------------+ | NULL | | 2007-11-12 15:11:22 | +---------------------+ 2 rows in set (0.00 sec) mysql>