Description:
When a table contains a single TIMESTAMP value, a SELECT statement using a WHERE clause with the condition (c1) >= SOME (SELECT c1 FROM ...) incorrectly returns an empty set. The logical condition is effectively X >= X, which should always evaluate to TRUE.
How to repeat:
CREATE TABLE t849 (c1 TIMESTAMP);
INSERT IGNORE INTO t849 (c1) VALUES ('2050-04-19 08:36:49');
SELECT c1 FROM t849 WHERE (((c1) >= SOME (SELECT c1 FROM t849)));
-- return null
SELECT SUM(count) FROM (SELECT ((((c1) >= SOME (SELECT c1 FROM t849)))) IS TRUE AS count FROM t849) AS ta_norec;
-- return 1
Description: When a table contains a single TIMESTAMP value, a SELECT statement using a WHERE clause with the condition (c1) >= SOME (SELECT c1 FROM ...) incorrectly returns an empty set. The logical condition is effectively X >= X, which should always evaluate to TRUE. How to repeat: CREATE TABLE t849 (c1 TIMESTAMP); INSERT IGNORE INTO t849 (c1) VALUES ('2050-04-19 08:36:49'); SELECT c1 FROM t849 WHERE (((c1) >= SOME (SELECT c1 FROM t849))); -- return null SELECT SUM(count) FROM (SELECT ((((c1) >= SOME (SELECT c1 FROM t849)))) IS TRUE AS count FROM t849) AS ta_norec; -- return 1