Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.6, 10.11, 11.4, 11.8
-
Unexpected results
Description
Hi,
I found a logic bug in MariaDB when using a Boolean value as the parameter of a prepared statement. In the following test case, the where condition should return false, but the query still return one row:
CREATE TABLE t0(c0 REAL); |
CREATE TABLE t1 LIKE t0; |
INSERT INTO t1 VALUES (1); |
INSERT INTO t0 VALUES (1); |
SET @a = false; |
PREPARE prepare_query FROM "SELECT t1.c0, t0.c0 FROM t1 LEFT JOIN t0 ON 'J' WHERE (? OR ((t0.c0 IS TRUE) IN ('*_')))"; |
EXECUTE prepare_query USING @a; |
--- c0 c0
|
--- 1 NULL |
The equivalent normal query returns an empty result, which is incorrect:
SELECT t1.c0, t0.c0 FROM t1 LEFT JOIN t0 ON FALSE WHERE (FALSE OR ((t0.c0 IS TRUE) IN (FALSE))); |
Attachments
Issue Links
- relates to
-
MDEV-37616 Unexpected result of IN operator
-
- Closed
-