Second crash with get_fanout_with_deps() with semijoin + materialization

Bug #860300 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Undecided
Sergey Petrunia

Bug Description

 backtrace:

#4 <signal handler called>
#5 0x0824ef48 in get_fanout_with_deps (join=0xae52e5f0, tset=0) at item_subselect.cc:4397
#6 0x0824f0ba in get_post_group_estimate (join=0xae52e5f0, join_op_rows=2) at item_subselect.cc:4531
#7 0x082464a4 in Item_in_subselect::optimize (this=0xae513ce8, out_rows=0xae8dff18, cost=0xae8dff10) at item_subselect.cc:630
#8 0x083de322 in convert_subq_to_jtbm (parent_join=0xae529368, subq_pred=0xae513ce8, remove_item=0xae8dff7b) at opt_subselect.cc:1398
#9 0x083dd077 in convert_join_subqueries_to_semijoins (join=0xae529368) at opt_subselect.cc:843
#10 0x0831b540 in JOIN::optimize (this=0xae529368) at sql_select.cc:897
#11 0x08321e11 in mysql_select (thd=0xb36d6e0, rref_pointer_array=0xb36f25c, tables=0xae5127e0, wild_num=1, fields=..., conds=0xae513ce8, og_num=0,
    order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0xae513e90, unit=0xb36ee40, select_lex=0xb36f120)
    at sql_select.cc:2886
#12 0x08319c67 in handle_select (thd=0xb36d6e0, lex=0xb36ede4, result=0xae513e90, setup_tables_done_option=0) at sql_select.cc:283
#13 0x082b4434 in execute_sqlcom_select (thd=0xb36d6e0, all_tables=0xae5127e0) at sql_parse.cc:5110
#14 0x082ab1f1 in mysql_execute_command (thd=0xb36d6e0) at sql_parse.cc:2250
#15 0x082b6a63 in mysql_parse (thd=0xb36d6e0,
    rawbuf=0xae5125f0 "SELECT *\nFROM t3\nWHERE ( 'h' ) IN (\nSELECT f6\nFROM t4\nWHERE ( 5 ) IN ( SELECT f2 FROM t1 )\nGROUP BY t4.f6\n)", length=107,
    found_semicolon=0xae8e1228) at sql_parse.cc:6110
#16 0x082a8e40 in dispatch_command (command=COM_QUERY, thd=0xb36d6e0,
    packet=0xb3c6321 "SELECT *\nFROM t3\nWHERE ( 'h' ) IN (\nSELECT f6\nFROM t4\nWHERE ( 5 ) IN ( SELECT f2 FROM t1 )\nGROUP BY t4.f6\n)", packet_length=107)
    at sql_parse.cc:1221
#17 0x082a829b in do_command (thd=0xb36d6e0) at sql_parse.cc:916
#18 0x082a527f in handle_one_connection (arg=0xb36d6e0) at sql_connect.cc:1191
#19 0x00821919 in start_thread () from /lib/libpthread.so.0
#20 0x0076acce in clone () from /lib/libc.so.6

optimizer switch:

semijoin=ON,materialization=ON

Explain also crashes.

Test case:

CREATE TABLE t1 ( f2 int) ;
INSERT INTO t1 VALUES (9),(6);

CREATE TABLE t3 ( f4 int) ;

CREATE TABLE t4 ( f6 varchar(1) ) ;

SET SESSION optimizer_switch='semijoin=ON,materialization=ON';

SELECT *
FROM t3
WHERE ( 'h' ) IN (
        SELECT f6
        FROM t4
        WHERE ( 5 ) IN ( SELECT f2 FROM t1 )
        GROUP BY t4.f6
);

bzr version-info:

revision-id: <email address hidden>
date: 2011-09-26 23:54:00 +0300
build-date: 2011-09-27 09:49:21 +0300
revno: 3196
branch-nick: maria-5.3

Changed in maria:
milestone: none → 5.3
assignee: nobody → Sergey Petrunia (sergefp)
Changed in maria:
status: New → 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.