Assertion `outer_join->table_count > 0' failed in JOIN::choose_subquery_plan() with materialization=on,semijoin=off in maria-5.3

Bug #800679 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Timour Katchaounov

Bug Description

assertion:

mysqld: opt_subselect.cc:4374: bool JOIN::choose_subquery_plan(table_map): Assertion `outer_join->table_count > 0' failed.

backtrace:

#6 0x00000033b58296e6 in __assert_fail () from /lib64/libc.so.6
#7 0x00000000007ffb72 in JOIN::choose_subquery_plan (this=0x77a2eb0, join_tables=0) at opt_subselect.cc:4374
#8 0x0000000000747d1c in make_join_statistics (join=0x77a2eb0, tables_list=..., conds=0x0, keyuse_array=0x77a8e60) at sql_select.cc:3506
#9 0x000000000074a0e6 in JOIN::optimize (this=0x77a2eb0) at sql_select.cc:1100
#10 0x000000000057a27a in st_select_lex::optimize_unflattened_subqueries (this=0x76d8808) at sql_lex.cc:3172
#11 0x0000000000800aea in JOIN::optimize_unflattened_subqueries (this=0x7756fb0) at opt_subselect.cc:4200
#12 0x000000000074c0f5 in JOIN::optimize (this=0x7756fb0) at sql_select.cc:1606
#13 0x000000000074dc05 in mysql_select (thd=0x76d5ed8, rref_pointer_array=0x76d8a28, tables=0x771cbd8, wild_num=1, fields=..., conds=0x771e238, og_num=0,
    order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x771e4e8, unit=0x76d8320, select_lex=0x76d8808)
    at sql_select.cc:2871
#14 0x0000000000754084 in handle_select (thd=0x76d5ed8, lex=0x76d8280, result=0x771e4e8, setup_tables_done_option=0) at sql_select.cc:283
#15 0x00000000006a1554 in execute_sqlcom_select (thd=0x76d5ed8, all_tables=0x771cbd8) at sql_parse.cc:5082
#16 0x00000000006a3207 in mysql_execute_command (thd=0x76d5ed8) at sql_parse.cc:2227
#17 0x00000000006abf9f in mysql_parse (thd=0x76d5ed8, rawbuf=0x771c990 "SELECT *\nFROM t1, t2\nWHERE\n( t1.f1 ) IN ( SELECT f1 FROM t3 ) LIMIT 0",
    length=69, found_semicolon=0x4184bf08) at sql_parse.cc:6083
#18 0x00000000006ace37 in dispatch_command (command=COM_QUERY, thd=0x76d5ed8,
    packet=0x7713619 "SELECT *\nFROM t1, t2\nWHERE\n( t1.f1 ) IN ( SELECT f1 FROM t3 ) LIMIT 0", packet_length=69) at sql_parse.cc:1206
#19 0x00000000006ae449 in do_command (thd=0x76d5ed8) at sql_parse.cc:904
#20 0x0000000000698efb in handle_one_connection (arg=0x76d5ed8) at sql_connect.cc:1177
#21 0x00000033b600673d in start_thread () from /lib64/libpthread.so.0
#22 0x00000033b58d40cd in clone () from /lib64/libc.so.6

Explain:

crashes

minimal optimizer_switch: materialization=on,semijoin=off

total optimizer_switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=off,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on

bzr version-info:

revision-id: <email address hidden>
date: 2011-06-21 18:17:28 -0700
build-date: 2011-06-22 16:06:38 +0300
revno: 3054
branch-nick: maria-5.3

test case:

SET SESSION optimizer_switch='materialization=on,semijoin=off';

CREATE TABLE t1 ( f1 int);
CREATE TABLE t2 ( f1 int);
CREATE TABLE t3 ( f1 int);

SELECT * FROM t1, t2
WHERE ( t1.f1 ) IN ( SELECT f1 FROM t3 )
LIMIT 0;

Changed in maria:
milestone: none → 5.3
assignee: nobody → Timour Katchaounov (timour)
Changed in maria:
importance: Undecided → Critical
Changed in maria:
status: New → In Progress
Changed in maria:
status: In Progress → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.