Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Duplicate
-
11.8.5
-
None
-
Not for Release Notes
Description
When executing a query with a complex logical expression composed of string/integer/bitwise/XOR operations in the WHERE clause,both the condition and its negation (NOT) return the same row.
This is a critical logical error that breaks fundamental boolean logic.A row cannot simultaneously satisfy a condition AND its negation.
Steps to Reproduce:
DROP DATABASE IF EXISTS database28;
CREATE DATABASE database28;
USE database28;
CREATE TABLE `t0` (
`c0` double DEFAULT NULL,
UNIQUE KEY `c0` (`c0`),
KEY `ic2` (`c0` DESC)
);
INSERT INTO t0 VALUES (908772674);
– Query 1
SELECT t0.c0 FROM t0
WHERE NOT ('.6OF}~L9' XOR ((-1747543273 IN (t0.c0, t0.c0)) ^ 1028288693));
– Query 2 (logical negation of Query 1)
SELECT t0.c0 FROM t0
WHERE ('.6OF}~L9' XOR ((-1747543273 IN (t0.c0, t0.c0)) ^ 1028288693));
Actual Result
Both queries return the same row:
-----------
| c0 |
-----------
| 908772674 |
-----------
1 row in set, 1 warning (0.00 sec)
Attachments
Issue Links
- duplicates
-
MDEV-39363 Logical Bug in `NOT ( ... XOR ... )` Evaluation with Implicit Type Conversion
-
- Closed
-