Wrong result with in_to_exists, constant table , semijoin=OFF,materialization=OFF
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MariaDB |
Fix Released
|
High
|
Timour Katchaounov | ||
Bug Description
The following query:
SELECT *
FROM t1
WHERE t1.a IN (
SELECT t2.a
FROM t2
WHERE t2.a < 'ZZZ'
);
returns rows that do not match the WHERE predicate when executed with in_to_exists. Forcing in_to_exists requires disabling semijoin and materialization.
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1
minimal switch: semijoin=
full switch: index_merge=
repeatable in maria-5.3. not repeatable in maria-5.2, mysql-5.5
bzr version-info
revision-id: <email address hidden>
date: 2011-11-24 15:12:10 +0200
build-date: 2011-11-24 16:14:10 +0200
revno: 3310
branch-nick: maria-5.3
test case:
CREATE TABLE t1 (a varchar(3));
INSERT INTO t1 VALUES ('AAA'),('BBB');
CREATE TABLE t2 (a varchar(3));
INSERT INTO t2 VALUES ('CCC');
SELECT *
FROM t1
WHERE t1.a IN (
SELECT t2.a
FROM t2
WHERE t2.a < 'ZZZ'
);
Related branches
| Changed in maria: | |
| milestone: | none → 5.5 |
| milestone: | 5.5 → 5.3 |
| assignee: | nobody → Timour Katchaounov (timour) |
| Changed in maria: | |
| importance: | Undecided → Medium |
| Changed in maria: | |
| importance: | Medium → High |
| Changed in maria: | |
| status: | New → In Progress |
| Changed in maria: | |
| status: | In Progress → Fix Released |
