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 query uses a bitwise AND predicate involving AES_ENCRYPT() and INTERVAL arithmetic, the predicate may be evaluated inconsistently between WHERE filtering and SELECT expression evaluation.
In this case, the WHERE clause returns an empty result set, while evaluating the same predicate as a SELECT expression indicates that one row satisfies the condition.
CREATE TABLE t1472 (c1 NUMERIC); |
INSERT INTO t1472 (c1) VALUES (295082); |
SELECT ta2.ca1 FROM (SELECT t1472.c1 FROM t1472) AS ta1 JOIN (SELECT t1472.c1 AS ca1 FROM t1472) AS ta2 WHERE (AES_ENCRYPT((CONCAT(ta2.ca1, ta2.ca1, ta2.ca1, 'kQGVptlWbA2Wa0LQm3eRzeQFby6he8', '2005-09-17 23:39:23')), '16:11:46') & ('241110' - INTERVAL '08:20:28' HOUR_SECOND)); |
--empty set
|
SELECT SUM(count) FROM (SELECT (AES_ENCRYPT((CONCAT(ta2.ca1, ta2.ca1, ta2.ca1, 'kQGVptlWbA2Wa0LQm3eRzeQFby6he8', '2005-09-17 23:39:23')), '16:11:46') & ('241110' - INTERVAL '08:20:28' HOUR_SECOND)) IS TRUE AS count FROM (SELECT t1472.c1 FROM t1472) AS ta1 JOIN (SELECT t1472.c1 AS ca1 FROM t1472) AS ta2) AS ta_norec; |
--1 |
Attachments
Issue Links
- duplicates
-
MDEV-40090 Wrong result for predicate involving invalid DATETIME conversion and BLOB arithmetic
-
- Confirmed
-