Assertion `!join_tab->cache->next_cache' failed in sql_select.cc:8645: void set_join_cache_denial(JOIN_TAB*)

Bug #899696 reported by Elena Stepanova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Igor Babaev

Bug Description

mysqld: sql_select.cc:8645: void set_join_cache_denial(JOIN_TAB*): Assertion `!join_tab->cache->next_cache' failed.

#6 0x00007fca28fa0235 in __assert_fail () from /lib64/libc.so.6
#7 0x00000000007853c4 in set_join_cache_denial (join_tab=0x3060048)
    at sql_select.cc:8645
#8 0x0000000000785690 in revise_cache_usage (join_tab=0x3060688)
    at sql_select.cc:8771
#9 0x00000000007862fd in check_join_cache_usage (tab=0x3060688, options=0,
    no_jbuf_after=4, table_index=3, prev_tab=0x3060368) at sql_select.cc:9173
#10 0x000000000078646a in check_join_cache_usage_for_tables (join=0x30a68f0,
    options=0, no_jbuf_after=4) at sql_select.cc:9252
#11 0x00000000007867bd in make_join_readinfo (join=0x30a68f0, options=0,
    no_jbuf_after=4) at sql_select.cc:9337
#12 0x00000000007717be in JOIN::optimize (this=0x30a68f0) at sql_select.cc:1500
#13 0x0000000000776859 in mysql_select (thd=0x7fca100c89d8,
    rref_pointer_array=0x7fca100cb5b0, tables=0x30385e8, wild_num=1,
    fields=..., conds=0x30576d0, og_num=0, order=0x0, group=0x0, having=0x0,
    proc_param=0x0, select_options=2147764736, result=0x303a338, unit=
    0x7fca100cae78, select_lex=0x7fca100cb360) at sql_select.cc:2892
#14 0x000000000076d4c9 in handle_select (thd=0x7fca100c89d8,
    lex=0x7fca100cadd8, result=0x303a338, setup_tables_done_option=0)
    at sql_select.cc:283
#15 0x00000000006fc648 in execute_sqlcom_select (thd=0x7fca100c89d8,
    all_tables=0x30385e8) at sql_parse.cc:5112
#16 0x00000000006f371e in mysql_execute_command (thd=0x7fca100c89d8)
    at sql_parse.cc:2250
#17 0x00000000006ff028 in mysql_parse (thd=0x7fca100c89d8,
    rawbuf=0x30383a0 "SELECT * FROM t1, t2 WHERE b IN ( SELECT a FROM t1, t2 WHERE b = pk )", length=69, found_semicolon=0x7fca2a97cc98) at sql_parse.cc:6113
#18 0x00000000006f0f36 in dispatch_command (command=COM_QUERY,
    thd=0x7fca100c89d8,
    packet=0x7fca10146cd9 "SELECT * FROM t1, t2 WHERE b IN ( SELECT a FROM t1, t2 WHERE b = pk )", packet_length=69) at sql_parse.cc:1221
#19 0x00000000006f026a in do_command (thd=0x7fca100c89d8) at sql_parse.cc:916
#20 0x00000000006ed1c0 in handle_one_connection (arg=0x7fca100c89d8)
    at sql_connect.cc:1191
#21 0x00007fca29c5ba4f in start_thread () from /lib64/libpthread.so.0
#22 0x00007fca2904582d in clone () from /lib64/libc.so.6

bzr revno: 3324
revision-id: <email address hidden>

Reproducible on 3315 as well.

Revision history for this message
Elena Stepanova (elenst) wrote :

Full 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=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on

Minimal switch: semijoin_with_cache=on
(included into the test case)

Reproducible with join_cache_level = 2, 3, 6, 7, 8

InnoDB as the 2nd table's engine seems essential

Also fails on EXPLAIN.

test case:

--source include/have_innodb.inc

SET optimizer_switch = 'semijoin_with_cache=on';
SET join_cache_level = 2; # same assertion for 3,6,7,8

CREATE TABLE t1 ( pk INTEGER PRIMARY KEY, a INTEGER );
INSERT INTO t1 VALUES (1, 6),(2, 8);
CREATE TABLE t2 ( b INTEGER ) ENGINE=InnoDB;
INSERT INTO t2 VALUES (3);

SELECT * FROM t1, t2 WHERE b IN ( SELECT a FROM t1, t2 WHERE b = pk );

Changed in maria:
assignee: nobody → Sergey Petrunia (sergefp)
Changed in maria:
milestone: none → 5.3
assignee: Sergey Petrunia (sergefp) → Igor Babaev (igorb-seattle)
importance: Undecided → Critical
Changed in maria:
status: New → Confirmed
Changed in maria:
status: Confirmed → 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.