Bug #119370 FLOAT Value Returned by CASE Statement Evaluates Incorrectly in Bitwise Operation
Submitted: 12 Nov 10:07
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

[12 Nov 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