Bug #117453 Unexpected results with ACOS function in WHERE clause.
Submitted: 13 Feb 1:51 Modified: 13 Feb 5:18
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.41 OS:Windows (windows 11)
Assigned to: CPU Architecture:x86 (x86_64)

[13 Feb 1:51] wang jack
Description:
From my understanding, the first query below should return 1 row, but it is actually return empty.

mysql> SELECT t0.c0 FROM t0 WHERE (NOT (ACOS(((t0.c0)^((CASE  EXISTS (SELECT 1) WHEN (- (NULL)) THEN "" ELSE 0.6189444855278164 END ))))));
Empty set (0.00 sec)

mysql> SELECT ALL SUM(((NOT (ACOS(((t0.c0)^((CASE  EXISTS (SELECT 1) WHEN (- (NULL)) THEN "" ELSE 0.6189444855278164 END ))))))) IS TRUE) FROM t0;
+-------------------------------------------------------------------------------------------------------------------------+
| SUM(((NOT (ACOS(((t0.c0)^((CASE  EXISTS (SELECT 1) WHEN (- (NULL)) THEN "" ELSE 0.6189444855278164 END ))))))) IS TRUE) |
+-------------------------------------------------------------------------------------------------------------------------+
|                                                                                                                       1 |
+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

How to repeat:
DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 DOUBLE) ;
REPLACE INTO t0(c0) VALUES(0.4012640559729792);

SELECT t0.c0 FROM t0 WHERE (NOT (ACOS(((t0.c0)^((CASE  EXISTS (SELECT 1) WHEN (- (NULL)) THEN "" ELSE 0.6189444855278164 END ))))));
SELECT ALL SUM(((NOT (ACOS(((t0.c0)^((CASE  EXISTS (SELECT 1) WHEN (- (NULL)) THEN "" ELSE 0.6189444855278164 END ))))))) IS TRUE) FROM t0;
[13 Feb 5:18] MySQL Verification Team
Hello wang jack,

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

regards,
Umesh