Bug #60724 Unquoted date literal in comparison yields incorrect implicit conversion
| Submitted: | 1 Apr 2011 16:19 | Modified: | 14 Dec 2025 17:26 |
|---|---|---|---|
| Reporter: | Yvan Rodrigues | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S2 (Serious) |
| Version: | 5.5.11, 5.5.10-log, 5.1.57, 5.0.93 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | <, =, >, conversion, date, datetime, implicit conversion, literal, unquoted | ||
[1 Apr 2011 16:19]
Yvan Rodrigues
[1 Apr 2011 16:32]
Valeriy Kravchuk
Verified just as described: macbook-pro:5.5 openxs$ 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 1 Server version: 5.5.11-debug Source distribution Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select NOW() > 20120101; +------------------+ | NOW() > 20120101 | +------------------+ | 1 | +------------------+ 1 row in set (0.00 sec) mysql> select NOW() > '20120101'; +--------------------+ | NOW() > '20120101' | +--------------------+ | 0 | +--------------------+ 1 row in set (0.00 sec) mysql> select now() > CAST(20120101 AS DATETIME); +------------------------------------+ | now() > CAST(20120101 AS DATETIME) | +------------------------------------+ | 0 | +------------------------------------+ 1 row in set (0.00 sec)
[14 Dec 2025 17:26]
Roy Lyseng
Posted by developer: Not reproducble in version 8.0 and later.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.