Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
Not reproducible in maria-5.2. The following query:
SELECT * FROM t1 WHERE (f3 = 83) OR (f10 = 'q' AND f3 IS NULL);
returns
----------+
| f3 | f10 |
----------+
| NULL | r |
----------+
which is obviously wrong since neither f3 = 83 nor f10 = 'q'
test case:
CREATE TABLE t1 (
f3 int(11),
f10 varchar(1),
KEY (f3)
);
INSERT IGNORE INTO t1 VALUES ('9','k'),(NULL,'r');
SELECT * FROM t1 WHERE (f3 = 83) OR (f10 = 'z' AND f3 IS NULL);
bzr version-info:
revision-id: <email address hidden>
date: 2011-03-01 10:22:22 +0300
build-date: 2011-03-02 11:45:01 +0200
revno: 2928
branch-nick: maria-5.3
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Re: Wrong result with OR + NOT NULL in maria-5.3
In 5.3:
MariaDB [j28]> explain SELECT * FROM t1 WHERE (f3 = 83) OR (f10 = 'z' AND f3 IS NULL);
---
------------------------------------------------------------------+---
------------------------------------------------------------------+---
------------------------------------------------------------------+1 row in set (0.01 sec)
Note the lack of "Using where". Debugging shows that