Bug #119370 FLOAT Value Returned by CASE Statement Evaluates Incorrectly in Bitwise Operation

Submitted: 12 Nov 2025 10:07 Modified: 6 Dec 2025 22:40
Reporter: zz z Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:9.4.0 8.4.6 OS:Any
Assigned to: CPU Architecture:Any

[12 Nov 2025 10:07] zz z
Description:
When a large FLOAT literal is used directly in a bitwise XOR (^) operation, it is correctly converted to a BIGINT UNSIGNED integer, and the query behaves as expected. However, when the exact same FLOAT literal is returned by a CASE statement, its type is handled incorrectly before the bitwise operation.

How to repeat:
CREATE TABLE t1855 (c1 INT8);
INSERT t1855 () VALUES (8629672225906417705);

SELECT * FROM t1855 WHERE(((CASE WHEN 1 THEN 1.849617210394965E38 ELSE NULL END) ^ t1855.c1) < (8629672225906417705));
-- 1 ROWS SELECTED
SELECT * FROM t1855 WHERE((1.849617210394965E38 ^ t1855.c1) < (8629672225906417705));
-- 0
[6 Dec 2025 22:40] Roy Lyseng
Verified as described.

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

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