|
Reproducible on 5.5-10.1, not on 10.2
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (c1 smallint(5) DEFAULT '0' PRIMARY KEY ) ENGINE=Innodb;
|
CREATE TABLE t2 (c2 int,c1 int,PRIMARY KEY (c2,c1)) ENGINE=Innodb;
|
CREATE TABLE t3 (c2 int, c3 int, PRIMARY KEY (c2)) ENGINE=Innodb;
|
|
INSERT INTO t2 VALUES (349,25502),(349,25636),(349,25697),(349,25698),(349,25699),(349,25700),(349,25701),(349,25702),(349,25703),
|
(349,25704),(349,25705),(349,25706),(350,25455),(350,25456),(350,25457),(350,25458),(350,25459),(350,25460),(350,25461),(350,25462),
|
(350,25463),(350,25464),(350,25465),(350,25503),(350,25504),(350,25505),(350,25506),(350,25677),(350,25678),(350,25679),(350,25680),
|
(355,25793),(356,25794),(357,25795),(358,26026);
|
|
SET optimizer_search_depth=63;
|
SELECT count(*) FROM t1 WHERE c1 IN (SELECT c1 FROM t2 INNER JOIN t3 USING(c2) WHERE c3 = 1 );
|
|
ANALYZE TABLE t1;
|
ANALYZE TABLE t2;
|
ANALYZE TABLE t3;
|
|
SELECT count(*) FROM t1 WHERE c1 IN (SELECT c1 FROM t2 INNER JOIN t3 USING(c2) WHERE c3 = 1 );
|
|
DROP TABLE IF EXISTS t1,t2,t3;
|
5.5 ac3fd5acac6b3717ce206e3
|
Thread 1 (Thread 0x7f6c1ee61700 (LWP 30170)):
|
#0 __pthread_kill (threadid=<optimized out>, signo=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
|
#1 0x0000000000d1c181 in my_write_core (sig=11) at /home/alice/git/5.5/mysys/stacktrace.c:457
|
#2 0x00000000007dce6e in handle_fatal_signal (sig=11) at /home/alice/git/5.5/sql/signal_handler.cc:262
|
#3 <signal handler called>
|
#4 0x00000000007643ef in optimize_semijoin_nests (join=0x7f6c0e850e18, all_table_map=7) at /home/alice/git/5.5/sql/opt_subselect.cc:2382
|
#5 0x000000000064f41d in make_join_statistics (join=0x7f6c0e850e18, tables_list=..., conds=0x7f6c0e87af18, keyuse_array=0x7f6c0e851178) at /home/alice/git/5.5/sql/sql_select.cc:3814
|
#6 0x00000000006459a9 in JOIN::optimize (this=0x7f6c0e850e18) at /home/alice/git/5.5/sql/sql_select.cc:1247
|
#7 0x000000000064c9a9 in mysql_select (thd=0x7f6c17b67000, rref_pointer_array=0x7f6c17b6ad28, tables=0x7f6c0e84e418, wild_num=0, fields=..., conds=0x7f6c0e8451d8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f6c0e844418, unit=0x7f6c17b6a328, select_lex=0x7f6c17b6aa28) at /home/alice/git/5.5/sql/sql_select.cc:3104
|
#8 0x00000000006429fd in handle_select (thd=0x7f6c17b67000, lex=0x7f6c17b6a278, result=0x7f6c0e844418, setup_tables_done_option=0) at /home/alice/git/5.5/sql/sql_select.cc:323
|
#9 0x00000000006190fa in execute_sqlcom_select (thd=0x7f6c17b67000, all_tables=0x7f6c0e84e418) at /home/alice/git/5.5/sql/sql_parse.cc:4678
|
#10 0x0000000000611bb4 in mysql_execute_command (thd=0x7f6c17b67000) at /home/alice/git/5.5/sql/sql_parse.cc:2224
|
#11 0x000000000061c032 in mysql_parse (thd=0x7f6c17b67000, rawbuf=0x7f6c0e893678 "SELECT count(*) FROM t1 WHERE c1 IN (SELECT c1 FROM t2 INNER JOIN t3 USING(c2) WHERE c3 = 1 )", length=93, parser_state=0x7f6c1ee60660) at /home/alice/git/5.5/sql/sql_parse.cc:5923
|
#12 0x000000000060ef22 in dispatch_command (command=COM_QUERY, thd=0x7f6c17b67000, packet=0x7f6c16933001 "SELECT count(*) FROM t1 WHERE c1 IN (SELECT c1 FROM t2 INNER JOIN t3 USING(c2) WHERE c3 = 1 )", packet_length=93) at /home/alice/git/5.5/sql/sql_parse.cc:1066
|
#13 0x000000000060e093 in do_command (thd=0x7f6c17b67000) at /home/alice/git/5.5/sql/sql_parse.cc:793
|
#14 0x0000000000723fbb in do_handle_one_connection (thd_arg=0x7f6c17b67000) at /home/alice/git/5.5/sql/sql_connect.cc:1268
|
#15 0x0000000000723d24 in handle_one_connection (arg=0x7f6c17b67000) at /home/alice/git/5.5/sql/sql_connect.cc:1184
|
#16 0x00000000009985fd in pfs_spawn_thread (arg=0x7f6c17bd6430) at /home/alice/git/5.5/storage/perfschema/pfs.cc:1015
|
#17 0x00007f6c1e00e6ba in start_thread (arg=0x7f6c1ee61700) at pthread_create.c:333
|
#18 0x00007f6c1d6b941d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
|