Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
11.4.11
-
None
-
MariaDB version: 11.4.11-MariaDB-ubu2404
Docker image: mariadb:11.4
Host OS: Windows 11
Runtime environment: Docker Desktop with WSL2 backend
-
Not for Release Notes
Description
When a SOME quantified comparison uses a MOD() expression over BLOB values, the predicate may be evaluated inconsistently between WHERE filtering and SELECT expression evaluation.
In this case, MOD() evaluates to 0 for one row and NULL for another row due to implicit numeric conversion of BLOB values. The WHERE query returns a different result from the SELECT expression evaluation, although both queries use the same predicate.
CREATE TABLE t218 (c1 MEDIUMBLOB); |
INSERT INTO t218 SET c1 = '8gaXJD8Gca8shgWnb'; |
INSERT INTO t218 (c1) VALUES ('TU32W5lblPm'); |
SELECT ta1.ca2 FROM (SELECT t218.c1 AS ca1, t218.c1 AS ca2 FROM t218) AS ta1 WHERE (MOD(ta1.ca1, ta1.ca2) < SOME (SELECT ta4.ca3 FROM (SELECT t218.c1 AS ca3 FROM t218) AS ta4)); |
--empty set
|
SELECT SUM(count) FROM (SELECT (MOD(ta1.ca1, ta1.ca2) < SOME (SELECT ta4.ca3 FROM (SELECT t218.c1 AS ca3 FROM t218) AS ta4)) IS TRUE AS count FROM (SELECT t218.c1 AS ca1, t218.c1 AS ca2 FROM t218) AS ta1) AS ta_norec; |
--1 |
Attachments
Issue Links
- duplicates
-
MDEV-40090 Wrong result for predicate involving invalid DATETIME conversion and BLOB arithmetic
-
- Confirmed
-