Assertion `0' failed in replace_where_subcondition with derived_merge and first execution of prepared statement
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Undecided
|
Sergey Petrunia |
Bug Description
This query:
SELECT *
FROM (
SELECT *
FROM t3
WHERE t3.b <= 'c'
) AS alias1
RIGHT JOIN t1
ON t1.a = alias1.b
AND ( 6 ) IN (
SELECT a
FROM t2
)
crashes when executed with derived_merge=ON, semijoin=ON and prepared statement.
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
optimizer switch: derived_
full switch: index_merge=
test case:
CREATE TABLE t1 ( a varchar(1)) ;
CREATE TABLE t2 ( a int(11), b int(11)) ;
CREATE TABLE t3 ( a int(11) NOT NULL , b varchar(1)) ;
SET SESSION optimizer_switch = 'derived_merge=on';
SET SESSION optimizer_switch = 'semijoin=on';
PREPARE st1 from "
SELECT *
FROM (
SELECT *
FROM t3
WHERE t3.b <= 0
) AS alias1
RIGHT JOIN t1
ON t1.a = alias1.b
AND ( 6 ) IN (
SELECT a
FROM t2
)";
EXECUTE st1;
bzr version-info
revision-id: <email address hidden>
date: 2011-10-19 21:01:42 +0200
build-date: 2011-10-20 13:09:07 +0300
revno: 3242
branch-nick: maria-5.3
Changed in maria: | |
assignee: | nobody → Sergey Petrunia (sergefp) |
milestone: | none → 5.3 |
Changed in maria: | |
status: | New → Confirmed |
Changed in maria: | |
status: | Confirmed → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
Also reproducible without a subquery in the ON clause. Let me know if you require such a testcase.