Bug #119147 >= SOME Operator Returns Incorrect Empty Set for TIMESTAMP Comparison
Submitted: 13 Oct 13:39
Reporter: zz z Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:9.4.0 8.4.6 OS:Any
Assigned to: CPU Architecture:Any

[13 Oct 13:39] zz z
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