Bug #112826 Decimal query with wrong result
Submitted: 25 Oct 2023 7:47 Modified: 25 Oct 2023 8:26
Reporter: Pedro Ferreira Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.1.0, 8.0.34 OS:Ubuntu (22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: decimal

[25 Oct 2023 7:47] Pedro Ferreira
Description:
Run these queries:

CREATE TABLE t0 (c0 INT, INDEX i0(c0)) AS (SELECT 1 c0);
SELECT 1 FROM t0 WHERE t0.c0 = -(-.5); -- 1 row
SELECT t0.c0 = -(-.5) FROM t0; -- returns 0

The cardinality of the first SELECT query should match the predicate result on the second, which is not the case. I also noticed this is only reproducible when the index is created.

The compilation parameters are the same as issue 108148:

-DWITH_DEBUG=1 -DWITH_ASAN=ON -DWITH_UBSAN=ON and boost library version 1.77

How to repeat:
Run the queries above.
[25 Oct 2023 8:26] MySQL Verification Team
Hello Pedro Ferreira,

Thank you for the report and feedback.

regards,
Umesh