|
Slightly different stack with this testcase:
# mysqld options required for replay: --innodb_strict_mode=OFF
|
SET join_cache_level=6;
|
CREATE TABLE t1 (c01 CHAR(200), c02 CHAR(200), c03 CHAR(200), c04 CHAR(200), c05 CHAR(200), c06 CHAR(200), c07 CHAR(200), c08 CHAR(200), c09 CHAR(200), c10 CHAR(200), c11 CHAR(200), c12 CHAR(200), c13 CHAR(200), c14 CHAR(200), c15 CHAR(200), c16 CHAR(200), c17 CHAR(200), c18 CHAR(200), c19 CHAR(200), c20 CHAR(200), c21 CHAR(200), c22 CHAR(200), c23 CHAR(200), c24 CHAR(200), c25 CHAR(200), c26 CHAR(200), c27 CHAR(200), c28 CHAR(200), c29 CHAR(200), c30 CHAR(200), c31 CHAR(200), c32 CHAR(200), c33 CHAR(200), c34 CHAR(200), c35 CHAR(200), c36 CHAR(200), c37 CHAR(200), c38 CHAR(200), c39 CHAR(200), c40 CHAR(157)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
|
CREATE TEMPORARY TABLE t3 LIKE t1;
|
SET optimizer_search_depth=1;
|
CREATE TABLE t4 (c1 INT NULL) ENGINE=InnoDB;
|
CREATE TABLE t2 (a INT NOT NULL, b INT, c INT, KEY(b), KEY(c), KEY(a)) ENGINE=InnoDB;
|
SELECT * FROM (t1 NATURAL JOIN t2) NATURAL LEFT JOIN (t3 NATURAL JOIN t4);
|
Leads to:
|
10.6.2 6c39eaeb126328e7813b146ecf652d51e4508981 (Optimized)
|
Core was generated by `/test/MD120621-mariadb-10.6.2-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 best_extension_by_limited_search (join=0x152f8c014bb8,
|
remaining_tables=12, idx=2, record_count=1, read_time=2.3999999999999999,
|
search_depth=1, prune_level=1, use_cond_selectivity=4)
|
at /test/10.6_opt/sql/sql_select.cc:9846
|
[Current thread is 1 (Thread 0x152fd4b28700 (LWP 2458123))]
|
(gdb) bt
|
#0 best_extension_by_limited_search (join=0x152f8c014bb8, remaining_tables=12, idx=2, record_count=1, read_time=2.3999999999999999, search_depth=1, prune_level=1, use_cond_selectivity=4) at /test/10.6_opt/sql/sql_select.cc:9846
|
#1 0x000055937caec5dc in greedy_search (use_cond_selectivity=<optimized out>, prune_level=<optimized out>, search_depth=1, remaining_tables=12, join=0x152f8c014bb8) at /test/10.6_opt/sql/sql_select.cc:9070
|
#2 choose_plan (join=0x152f8c014bb8, join_tables=<optimized out>) at /test/10.6_opt/sql/sql_select.cc:8635
|
#3 0x000055937cb18a8c in make_join_statistics (keyuse_array=0x152f8c014ed8, tables_list=@0x152f8c010b58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x152f8c015160, last = 0x152f8c015190, elements = 4}, <No data fields>}, join=0x152f8c014bb8) at /test/10.6_opt/sql/sql_select.cc:5875
|
#4 JOIN::optimize_inner (this=0x152f8c014bb8) at /test/10.6_opt/sql/sql_select.cc:2451
|
#5 0x000055937cb18f93 in JOIN::optimize (this=this@entry=0x152f8c014bb8) at /test/10.6_opt/sql/sql_select.cc:1807
|
#6 0x000055937cb19057 in mysql_select (thd=0x152f8c000c58, tables=0x152f8c010f18, fields=<optimized out>, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x152f8c014b90, unit=0x152f8c004e10, select_lex=0x152f8c010940) at /test/10.6_opt/sql/sql_select.cc:4968
|
#7 0x000055937cb19877 in handle_select (thd=thd@entry=0x152f8c000c58, lex=lex@entry=0x152f8c004d48, result=result@entry=0x152f8c014b90, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_opt/sql/sql_select.cc:544
|
#8 0x000055937caaa3f1 in execute_sqlcom_select (thd=0x152f8c000c58, all_tables=0x152f8c010f18) at /test/10.6_opt/sql/sql_parse.cc:6242
|
#9 0x000055937cab8126 in mysql_execute_command (thd=0x152f8c000c58) at /test/10.6_opt/sql/sql_parse.cc:3937
|
#10 0x000055937caa53f4 in mysql_parse (thd=0x152f8c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:8016
|
#11 0x000055937cab1295 in dispatch_command (command=COM_QUERY, thd=0x152f8c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.6_opt/sql/sql_class.h:1340
|
#12 0x000055937cab31f7 in do_command (thd=0x152f8c000c58, blocking=blocking@entry=true) at /test/10.6_opt/sql/sql_parse.cc:1406
|
#13 0x000055937cbc1057 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.6_opt/sql/sql_connect.cc:1410
|
#14 0x000055937cbc13bd in handle_one_connection (arg=arg@entry=0x55937f7bcf48) at /test/10.6_opt/sql/sql_connect.cc:1312
|
#15 0x000055937cf4a8f8 in pfs_spawn_thread (arg=0x55937f76b8e8) at /test/10.6_opt/storage/perfschema/pfs.cc:2201
|
#16 0x0000152fde461609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#17 0x0000152fde050293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
And on debug:
|
10.6.2 6c39eaeb126328e7813b146ecf652d51e4508981 (Debug)
|
Core was generated by `/test/MD120621-mariadb-10.6.2-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 restore_prev_nj_state (last=last@entry=0x100010001)
|
at /test/10.6_dbg/sql/sql_select.cc:17232
|
[Current thread is 1 (Thread 0x1510ed6e6700 (LWP 2487890))]
|
(gdb) bt
|
#0 restore_prev_nj_state (last=last@entry=0x100010001) at /test/10.6_dbg/sql/sql_select.cc:17232
|
#1 0x000055b69c44bd27 in best_extension_by_limited_search (join=join@entry=0x1510b8018318, remaining_tables=remaining_tables@entry=12, idx=idx@entry=2, record_count=record_count@entry=1, read_time=read_time@entry=2.3999999999999999, search_depth=search_depth@entry=1, prune_level=prune_level@entry=1, use_cond_selectivity=use_cond_selectivity@entry=4) at /test/10.6_dbg/sql/sql_select.cc:9996
|
#2 0x000055b69c44ce79 in greedy_search (use_cond_selectivity=<optimized out>, prune_level=<optimized out>, search_depth=1, remaining_tables=12, join=0x1510b8018318) at /test/10.6_dbg/sql/sql_select.cc:9070
|
#3 choose_plan (join=join@entry=0x1510b8018318, join_tables=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:8635
|
#4 0x000055b69c47bd3d in make_join_statistics (join=join@entry=0x1510b8018318, tables_list=@0x1510b80142b8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1510b80188c0, last = 0x1510b80188f0, elements = 4}, <No data fields>}, keyuse_array=keyuse_array@entry=0x1510b8018638) at /test/10.6_dbg/sql/sql_select.cc:5875
|
#5 0x000055b69c482ecb in JOIN::optimize_inner (this=this@entry=0x1510b8018318) at /test/10.6_dbg/sql/sql_select.cc:2451
|
#6 0x000055b69c483176 in JOIN::optimize (this=this@entry=0x1510b8018318) at /test/10.6_dbg/sql/sql_select.cc:1807
|
#7 0x000055b69c4837ef in mysql_select (thd=thd@entry=0x1510b8000db8, tables=0x1510b8014678, fields=@0x1510b8014340: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1510b8014630, last = 0x1510b80c5738, elements = 44}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x1510b80182f0, unit=0x1510b8005130, select_lex=0x1510b80140a0) at /test/10.6_dbg/sql/sql_select.cc:4968
|
#8 0x000055b69c483af3 in handle_select (thd=thd@entry=0x1510b8000db8, lex=lex@entry=0x1510b8005068, result=result@entry=0x1510b80182f0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:544
|
#9 0x000055b69c3f7460 in execute_sqlcom_select (thd=thd@entry=0x1510b8000db8, all_tables=0x1510b8014678) at /test/10.6_dbg/sql/sql_parse.cc:6242
|
#10 0x000055b69c404340 in mysql_execute_command (thd=thd@entry=0x1510b8000db8) at /test/10.6_dbg/sql/sql_parse.cc:3937
|
#11 0x000055b69c3f0890 in mysql_parse (thd=thd@entry=0x1510b8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1510ed6e5400) at /test/10.6_dbg/sql/sql_parse.cc:8016
|
#12 0x000055b69c3ff3fa in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1510b8000db8, packet=packet@entry=0x1510b800b769 "SELECT * FROM (t1 NATURAL JOIN t2) NATURAL LEFT JOIN (t3 NATURAL JOIN t4)", packet_length=packet_length@entry=73, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1340
|
#13 0x000055b69c4027da in do_command (thd=0x1510b8000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1406
|
#14 0x000055b69c566c8e in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b6a024e408, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
|
#15 0x000055b69c567293 in handle_one_connection (arg=arg@entry=0x55b6a024e408) at /test/10.6_dbg/sql/sql_connect.cc:1312
|
#16 0x000055b69ca15166 in pfs_spawn_thread (arg=0x55b6a0136aa8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
|
#17 0x0000151104aa7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#18 0x0000151104696293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.4.20 (dbg), 10.4.20 (opt), 10.5.11 (dbg), 10.5.11 (opt), 10.6.2 (dbg), 10.6.2 (opt)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.39 (dbg), 10.2.39 (opt), 10.3.30 (dbg), 10.3.30 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)
|