Bug #119262 Incorrect result on comparison between a float expression and an indexed SMALLINT column.

Submitted: 29 Oct 2025 9:01 Modified: 4 Nov 2025 23:01
Reporter: zz z Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.44,8.4.6,9.4.0 OS:Any
Assigned to: CPU Architecture:Any

[29 Oct 2025 9:01] zz z
Description:
The WHERE clause compares a floating-point expression, (3) / -1E37, with a SMALLINT column containing the value 0. 

How to repeat:
CREATE TABLE t7 (c2 SMALLINT, KEY (c2));
INSERT t7 () VALUES (0);
SELECT * FROM t7 WHERE (((3) / -1E37) = (c2)); -- return 0

CREATE TABLE t7 (c2 SMALLINT);
INSERT t7 () VALUES (0);
SELECT * FROM t7 WHERE (((3) / -1E37) = (c2)); -- return null
[4 Nov 2025 23:01] Roy Lyseng
Verified as described.

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

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