Bug #119137 Incorrect result for ADDTIME expression
Submitted: 13 Oct 3:23
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 3:23] zz z
Description:
When querying a table with a `VARCHAR` column using a complex expression involving `ATAN(ADDTIME(10, '2003-05-11'), c1) = 0` in the `WHERE` clause, the query incorrectly evaluates the condition.

How to repeat:
CREATE TABLE t245 (c1 VARCHAR(20));
INSERT INTO t245 (c1) VALUES ('DQ9');
SELECT c1 FROM t245 WHERE (((ATAN((ADDTIME(10, '2003-05-11')), c1))=0));
-- result count : 1
SELECT SUM(count) FROM (SELECT ((((ATAN((ADDTIME(10, '2003-05-11')), c1)) =0))) IS TRUE AS count FROM t245) AS ta_norec;
-- result: 0