JOIN::choose_subquery_plan(table_map): Assertion `outer_lookup_keys <= outer_record_count' failed with materialization in maria-5.3-mwl89
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Timour Katchaounov |
Bug Description
mysqld: opt_subselect.
backtrace:
JOIN::choose_
) [0x830dcd2]
JOIN::optimize(
st_select_
JOIN::optimize_
JOIN::optimize(
mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_
mysql_derived_
mysql_handle_
open_and_
open_and_
) [0x82a1dd8]
mysql_execute_
mysql_parse(THD*, char*, unsigned int, char const**)+0x26f) [0x82a4584]
dispatch_
do_command(
handle_
test case:
SET SESSION optimizer_switch = 'materializatio
CREATE TABLE t1 ( pk int(11), PRIMARY KEY (pk)) ;
CREATE TABLE t2 ( f2 int(11)) ;
CREATE TABLE t3 ( f1 int(11), f3 varchar(1), KEY (f1)) ;
INSERT INTO t3 VALUES (7,'f');
SELECT * FROM (
SELECT t1.* FROM t3
RIGHT JOIN t1 ON t1.pk = t3.f1
WHERE t3.f3 OR ( 3 ) IN ( SELECT f2 FROM t2 )
) AS a2;
revision-id: <email address hidden>
date: 2011-02-03 17:00:28 +0200
build-date: 2011-02-07 22:07:32 +0200
revno: 2883
branch-nick: maria-5.3-mwl89
not repeatable with maria-5.3
Related branches
Changed in maria: | |
assignee: | nobody → Timour Katchaounov (timour) |
milestone: | none → 5.3 |
Changed in maria: | |
importance: | Undecided → High |
status: | New → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
The problem query was reduced to:
SELECT t1.*
FROM t3 RIGHT JOIN t1 ON t1.pk = t3.f1
WHERE t3.f3 OR ( 3 ) IN ( SELECT f2 FROM t2 )
Both the RIGHT JOIN and the OR are needed because
otherwise the optimizer detects earlier that the subquery
result is empty.