Bug #117233 The same query involving TIME type returns different results with and without using an index.

Submitted: 18 Jan 2025 6:00 Modified: 20 Jan 2025 5:50
Reporter: wang jack Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:8.4.1,9.1.0, 8.0.40, 8.4.3 OS:Windows
Assigned to: CPU Architecture:x86

[18 Jan 2025 6:00] wang jack
Description:
The same query produces different results after dropping the index.

mysql> SELECT t0.c1 FROM t0 WHERE (NOT (('9.1.0') < (t0.c1))); -- empty
Empty set, 2 warnings (0.00 sec)

mysql> DROP INDEX i0 on t0;
Query OK, 0 rows affected (0.02 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> SELECT t0.c1 FROM t0 WHERE (NOT (('9.1.0') < (t0.c1))); -- 3 rows
+-----------+
| c1        |
+-----------+
| 572:38:29 |
| 176:45:47 |
| 466:52:44 |
+-----------+
3 rows in set, 1 warning (0.00 sec)

How to repeat:
DROP TABLE IF EXISTS t0;
CREATE TABLE IF NOT EXISTS t0(c1 TIME) ;
CREATE INDEX i0 ON t0(c1);
INSERT INTO t0(c1) VALUES('572:38:29'), ('176:45:47'), ('466:52:44');
SELECT t0.c1 FROM t0 WHERE (NOT (('9.1.0') < (t0.c1))); -- empty

DROP INDEX i0 on t0;
SELECT t0.c1 FROM t0 WHERE (NOT (('9.1.0') < (t0.c1))); -- 3 rows
[20 Jan 2025 5:50] MySQL Verification Team
Hello wang jack,

Thank you for the report and test case.
Verified as described.

regards,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.433 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.