Details
Description
Original testcase (reduced version in comments below):
CREATE TABLE v816 ( v817 TEXT ) ; |
INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; |
SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; |
Leads to:
10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug) |
Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500,
|
join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518
|
14518 order->depend_map|=(*tab)->ref.depend_map;
|
[Current thread is 1 (Thread 0x147c123c1700 (LWP 1070999))]
|
(gdb) bt
|
#0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518
|
#1 remove_const (join=join@entry=0x147bd8096ee8, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=simple_order@entry=0x147bd80971f4) at /test/10.9_dbg/sql/sql_select.cc:14631
|
#2 0x0000563600eae5dd in JOIN::optimize_stage2 (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2971
|
#3 0x0000563600eb15a7 in JOIN::optimize_inner (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2521
|
#4 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:1837
|
#5 0x0000563600df6462 in st_select_lex::optimize_unflattened_subqueries (this=0x147bd8014328, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916
|
#6 0x0000563600fe2f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/opt_subselect.cc:5622
|
#7 0x0000563600eb0490 in JOIN::optimize_inner (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:2157
|
#8 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:1837
|
#9 0x0000563600eb1a5f in mysql_select (thd=thd@entry=0x147bd8000db8, tables=0x147bd806f580, fields=@0x147bd80145c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147bd80148c0, last = 0x147bd8014b88, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x147bd8073500, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147bd807b5d8, unit=0x147bd8004fd8, select_lex=0x147bd8014328) at /test/10.9_dbg/sql/sql_select.cc:5022
|
#10 0x0000563600eb22a8 in handle_select (thd=thd@entry=0x147bd8000db8, lex=lex@entry=0x147bd8004f00, result=result@entry=0x147bd807b5d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570
|
#11 0x0000563600e1e6c8 in execute_sqlcom_select (thd=thd@entry=0x147bd8000db8, all_tables=0x147bd806f580) at /test/10.9_dbg/sql/sql_parse.cc:6271
|
#12 0x0000563600e2a935 in mysql_execute_command (thd=thd@entry=0x147bd8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961
|
#13 0x0000563600e1867b in mysql_parse (thd=thd@entry=0x147bd8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c123c0470) at /test/10.9_dbg/sql/sql_parse.cc:8046
|
#14 0x0000563600e25f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147bd8000db8, packet=packet@entry=0x147bd800b699 "SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823"..., packet_length=packet_length@entry=878, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364
|
#15 0x0000563600e28686 in do_command (thd=0x147bd8000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408
|
#16 0x0000563600f85d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5636047d2638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
|
#17 0x0000563600f8620b in handle_one_connection (arg=0x5636047d2638) at /test/10.9_dbg/sql/sql_connect.cc:1312
|
#18 0x0000147c2f257609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#19 0x0000147c2ee43163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Optimized) |
Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90,
|
join=0x15027c06cf90, order=0x15027c04b048)
|
at /test/10.9_opt/sql/sql_select.cc:14518
|
14518 order->depend_map|=(*tab)->ref.depend_map;
|
[Current thread is 1 (Thread 0x1502bc6a4700 (LWP 1070981))]
|
(gdb) bt
|
#0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518
|
#1 remove_const (join=0x15027c06cf90, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=0x15027c06d29c) at /test/10.9_opt/sql/sql_select.cc:14631
|
#2 0x0000564ef971e1ba in JOIN::optimize_stage2 (this=<optimized out>) at /test/10.9_opt/sql/sql_select.cc:2971
|
#3 0x0000564ef9721368 in JOIN::optimize_inner (this=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:2521
|
#4 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:1837
|
#5 0x0000564ef9687464 in st_select_lex::optimize_unflattened_subqueries (this=0x15027c010e08, const_only=const_only@entry=true) at /test/10.9_opt/sql/sql_lex.cc:4916
|
#6 0x0000564ef9809455 in JOIN::optimize_constant_subqueries (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/opt_subselect.cc:5622
|
#7 0x0000564ef971ff67 in JOIN::optimize_inner (this=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:2157
|
#8 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:1837
|
#9 0x0000564ef97237be in mysql_select (thd=0x15027c000c58, tables=0x15027c047138, fields=@0x15027c0110a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15027c0113a0, last = 0x15027c011660, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x15027c04b048, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x15027c053040, unit=0x15027c004cb8, select_lex=0x15027c010e08) at /test/10.9_opt/sql/sql_select.cc:5022
|
#10 0x0000564ef9723f57 in handle_select (thd=thd@entry=0x15027c000c58, lex=lex@entry=0x15027c004be0, result=result@entry=0x15027c053040, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_opt/sql/sql_select.cc:570
|
#11 0x0000564ef96a7a21 in execute_sqlcom_select (thd=0x15027c000c58, all_tables=0x15027c047138) at /test/10.9_opt/sql/sql_parse.cc:6271
|
#12 0x0000564ef96b5363 in mysql_execute_command (thd=0x15027c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:3961
|
#13 0x0000564ef96a2a55 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x15027c000c58) at /test/10.9_opt/sql/sql_parse.cc:8046
|
#14 mysql_parse (thd=0x15027c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:7968
|
#15 0x0000564ef96ae71a in dispatch_command (command=COM_QUERY, thd=0x15027c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.9_opt/sql/sql_class.h:1364
|
#16 0x0000564ef96b0642 in do_command (thd=0x15027c000c58, blocking=blocking@entry=true) at /test/10.9_opt/sql/sql_parse.cc:1408
|
#17 0x0000564ef97c55bf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564efb6494d8, put_in_cache=put_in_cache@entry=true) at /test/10.9_opt/sql/sql_connect.cc:1418
|
#18 0x0000564ef97c589d in handle_one_connection (arg=0x564efb6494d8) at /test/10.9_opt/sql/sql_connect.cc:1312
|
#19 0x00001502d5700609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#20 0x00001502d52ec163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt)
Bug (or feature/syntax) confirmed not present in:
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)
Attachments
Issue Links
- is part of
-
MDEV-30052 Crash with a query containing nested WINDOW clauses
-
- Closed
-
- relates to
-
MDEV-28516 SIGSEGV in get_sort_by_table, UBSAN: runtime error: member access within null pointer of type 'struct TABLE_LIST'
-
- Closed
-
-
MDEV-32258 MariaDB crash in JOIN optimization
-
- Closed
-
-
MDEV-28508 Server crash in /sql/sql_select.cc:18212: TABLE* create_tmp_table
-
- Closed
-
-
MDEV-28515 Assertion `field->table == table' failed in Create_tmp_table::finalize and create_tmp_table and SIGSEGV in hp_rec_hashnr
-
- Closed
-
-
MDEV-29681 Server crashes when optimizing SQL with ORDER BY
-
- Closed
-
-
MDEV-30756 Crash in get_sort_by_table / make_join_statistics / update_depend_map_for_order, various UBSAN pointer issues
-
- Stalled
-
Activity
Field | Original Value | New Value |
---|---|---|
Labels | fuzzer |
Priority | Critical [ 2 ] | Major [ 3 ] |
Link |
This issue relates to |
Affects Version/s | 10.3.35 [ 27512 ] |
Environment | ubuntu 18.04 |
Priority | Major [ 3 ] | Critical [ 2 ] |
Component/s | Optimizer [ 10200 ] | |
Component/s | Server [ 13907 ] |
Comment |
[ Thank you for the bug report. Best reduced/optimized testcase thus far:
{code:sql} CREATE TABLE t (c INT) ENGINE=InnoDB; SELECT * FROM (SELECT 1 FROM t AS a,t) AS b JOIN t AS d NATURAL JOIN t WINDOW e AS (PARTITION BY c AND 1 BETWEEN (SELECT c FROM t GROUP BY c WINDOW f AS (PARTITION BY c)) AND 2); {code} Leads to: {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 get_sort_by_table (const_tables=<optimized out>, tables=..., b=<optimized out>, a=0x0) at /test/10.9_dbg/sql/sql_select.cc:25516 25516 if (map != table->table->map) [Current thread is 1 (Thread 0x145888051700 (LWP 3001116))] (gdb) bt #0 get_sort_by_table (const_tables=<optimized out>, tables=@0x145844024bf0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14584407a970, last = 0x14584407a970, elements = 1}, <No data fields>}, b=<optimized out>, a=0x0) at /test/10.9_dbg/sql/sql_select.cc:25516 #1 make_join_statistics (join=join@entry=0x14584407a3b8, tables_list=@0x145844024bf0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14584407a970, last = 0x14584407a970, elements = 1}, <No data fields>}, keyuse_array=keyuse_array@entry=0x14584407a6d8) at /test/10.9_dbg/sql/sql_select.cc:5643 #2 0x00005577ba6f452c in JOIN::optimize_inner (this=this@entry=0x14584407a3b8) at /test/10.9_dbg/sql/sql_select.cc:2495 #3 0x00005577ba6f496c in JOIN::optimize (this=this@entry=0x14584407a3b8) at /test/10.9_dbg/sql/sql_select.cc:1837 #4 0x00005577ba639462 in st_select_lex::optimize_unflattened_subqueries (this=0x145844013db0, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916 #5 0x00005577ba825f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x145844027188) at /test/10.9_dbg/sql/opt_subselect.cc:5622 #6 0x00005577ba6f3490 in JOIN::optimize_inner (this=this@entry=0x145844027188) at /test/10.9_dbg/sql/sql_select.cc:2157 #7 0x00005577ba6f496c in JOIN::optimize (this=this@entry=0x145844027188) at /test/10.9_dbg/sql/sql_select.cc:1837 #8 0x00005577ba6f4a5f in mysql_select (thd=thd@entry=0x145844000db8, tables=0x145844015f10, fields=@0x145844014050: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x145844014340, last = 0x145844079e20, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x1458440257d0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x145844027160, unit=0x145844004fd8, select_lex=0x145844013db0) at /test/10.9_dbg/sql/sql_select.cc:5022 #9 0x00005577ba6f52a8 in handle_select (thd=thd@entry=0x145844000db8, lex=lex@entry=0x145844004f00, result=result@entry=0x145844027160, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570 #10 0x00005577ba6616c8 in execute_sqlcom_select (thd=thd@entry=0x145844000db8, all_tables=0x145844015f10) at /test/10.9_dbg/sql/sql_parse.cc:6271 #11 0x00005577ba66d935 in mysql_execute_command (thd=thd@entry=0x145844000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961 #12 0x00005577ba65b67b in mysql_parse (thd=thd@entry=0x145844000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x145888050470) at /test/10.9_dbg/sql/sql_parse.cc:8046 #13 0x00005577ba668f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x145844000db8, packet=packet@entry=0x14584400b699 "SELECT * FROM (SELECT 1 FROM t AS a,t) AS b JOIN t AS d NATURAL JOIN t WINDOW e AS (PARTITION BY c AND 1 BETWEEN (SELECT c FROM t GROUP BY c WINDOW f AS (PARTITION BY c)) AND 2)", packet_length=packet_length@entry=177, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364 #14 0x00005577ba66b686 in do_command (thd=0x145844000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408 #15 0x00005577ba7c8d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5577bcdf1638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #16 0x00005577ba7c920b in handle_one_connection (arg=0x5577bcdf1638) at /test/10.9_dbg/sql/sql_connect.cc:1312 #17 0x000014589fb0a609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #18 0x000014589f6f6163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt) Bug (or feature/syntax) confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt) ] |
Link |
This issue relates to |
Link |
This issue relates to |
Description |
We found a bug that cause mariadb crash.
POC: {code:sql} CREATE TABLE v816 ( v817 TEXT ) ; INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; {code} Stack dump is in the attachment. |
Original testcase:
{code:sql} CREATE TABLE v816 ( v817 TEXT ) ; INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; {code} Leads to: {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x147c123c1700 (LWP 1070999))] (gdb) bt #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 #1 remove_const (join=join@entry=0x147bd8096ee8, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=simple_order@entry=0x147bd80971f4) at /test/10.9_dbg/sql/sql_select.cc:14631 #2 0x0000563600eae5dd in JOIN::optimize_stage2 (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2971 #3 0x0000563600eb15a7 in JOIN::optimize_inner (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2521 #4 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:1837 #5 0x0000563600df6462 in st_select_lex::optimize_unflattened_subqueries (this=0x147bd8014328, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916 #6 0x0000563600fe2f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/opt_subselect.cc:5622 #7 0x0000563600eb0490 in JOIN::optimize_inner (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:2157 #8 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:1837 #9 0x0000563600eb1a5f in mysql_select (thd=thd@entry=0x147bd8000db8, tables=0x147bd806f580, fields=@0x147bd80145c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147bd80148c0, last = 0x147bd8014b88, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x147bd8073500, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147bd807b5d8, unit=0x147bd8004fd8, select_lex=0x147bd8014328) at /test/10.9_dbg/sql/sql_select.cc:5022 #10 0x0000563600eb22a8 in handle_select (thd=thd@entry=0x147bd8000db8, lex=lex@entry=0x147bd8004f00, result=result@entry=0x147bd807b5d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570 #11 0x0000563600e1e6c8 in execute_sqlcom_select (thd=thd@entry=0x147bd8000db8, all_tables=0x147bd806f580) at /test/10.9_dbg/sql/sql_parse.cc:6271 #12 0x0000563600e2a935 in mysql_execute_command (thd=thd@entry=0x147bd8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961 #13 0x0000563600e1867b in mysql_parse (thd=thd@entry=0x147bd8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c123c0470) at /test/10.9_dbg/sql/sql_parse.cc:8046 #14 0x0000563600e25f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147bd8000db8, packet=packet@entry=0x147bd800b699 "SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823"..., packet_length=packet_length@entry=878, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364 #15 0x0000563600e28686 in do_command (thd=0x147bd8000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408 #16 0x0000563600f85d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5636047d2638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #17 0x0000563600f8620b in handle_one_connection (arg=0x5636047d2638) at /test/10.9_dbg/sql/sql_connect.cc:1312 #18 0x0000147c2f257609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #19 0x0000147c2ee43163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt) Bug (or feature/syntax) confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt) |
Description |
Original testcase:
{code:sql} CREATE TABLE v816 ( v817 TEXT ) ; INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; {code} Leads to: {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x147c123c1700 (LWP 1070999))] (gdb) bt #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 #1 remove_const (join=join@entry=0x147bd8096ee8, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=simple_order@entry=0x147bd80971f4) at /test/10.9_dbg/sql/sql_select.cc:14631 #2 0x0000563600eae5dd in JOIN::optimize_stage2 (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2971 #3 0x0000563600eb15a7 in JOIN::optimize_inner (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2521 #4 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:1837 #5 0x0000563600df6462 in st_select_lex::optimize_unflattened_subqueries (this=0x147bd8014328, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916 #6 0x0000563600fe2f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/opt_subselect.cc:5622 #7 0x0000563600eb0490 in JOIN::optimize_inner (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:2157 #8 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:1837 #9 0x0000563600eb1a5f in mysql_select (thd=thd@entry=0x147bd8000db8, tables=0x147bd806f580, fields=@0x147bd80145c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147bd80148c0, last = 0x147bd8014b88, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x147bd8073500, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147bd807b5d8, unit=0x147bd8004fd8, select_lex=0x147bd8014328) at /test/10.9_dbg/sql/sql_select.cc:5022 #10 0x0000563600eb22a8 in handle_select (thd=thd@entry=0x147bd8000db8, lex=lex@entry=0x147bd8004f00, result=result@entry=0x147bd807b5d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570 #11 0x0000563600e1e6c8 in execute_sqlcom_select (thd=thd@entry=0x147bd8000db8, all_tables=0x147bd806f580) at /test/10.9_dbg/sql/sql_parse.cc:6271 #12 0x0000563600e2a935 in mysql_execute_command (thd=thd@entry=0x147bd8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961 #13 0x0000563600e1867b in mysql_parse (thd=thd@entry=0x147bd8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c123c0470) at /test/10.9_dbg/sql/sql_parse.cc:8046 #14 0x0000563600e25f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147bd8000db8, packet=packet@entry=0x147bd800b699 "SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823"..., packet_length=packet_length@entry=878, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364 #15 0x0000563600e28686 in do_command (thd=0x147bd8000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408 #16 0x0000563600f85d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5636047d2638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #17 0x0000563600f8620b in handle_one_connection (arg=0x5636047d2638) at /test/10.9_dbg/sql/sql_connect.cc:1312 #18 0x0000147c2f257609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #19 0x0000147c2ee43163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt) Bug (or feature/syntax) confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt) |
Original testcase:
{code:sql} CREATE TABLE v816 ( v817 TEXT ) ; INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; {code} Leads to: {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x147c123c1700 (LWP 1070999))] (gdb) bt #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 #1 remove_const (join=join@entry=0x147bd8096ee8, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=simple_order@entry=0x147bd80971f4) at /test/10.9_dbg/sql/sql_select.cc:14631 #2 0x0000563600eae5dd in JOIN::optimize_stage2 (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2971 #3 0x0000563600eb15a7 in JOIN::optimize_inner (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2521 #4 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:1837 #5 0x0000563600df6462 in st_select_lex::optimize_unflattened_subqueries (this=0x147bd8014328, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916 #6 0x0000563600fe2f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/opt_subselect.cc:5622 #7 0x0000563600eb0490 in JOIN::optimize_inner (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:2157 #8 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:1837 #9 0x0000563600eb1a5f in mysql_select (thd=thd@entry=0x147bd8000db8, tables=0x147bd806f580, fields=@0x147bd80145c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147bd80148c0, last = 0x147bd8014b88, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x147bd8073500, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147bd807b5d8, unit=0x147bd8004fd8, select_lex=0x147bd8014328) at /test/10.9_dbg/sql/sql_select.cc:5022 #10 0x0000563600eb22a8 in handle_select (thd=thd@entry=0x147bd8000db8, lex=lex@entry=0x147bd8004f00, result=result@entry=0x147bd807b5d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570 #11 0x0000563600e1e6c8 in execute_sqlcom_select (thd=thd@entry=0x147bd8000db8, all_tables=0x147bd806f580) at /test/10.9_dbg/sql/sql_parse.cc:6271 #12 0x0000563600e2a935 in mysql_execute_command (thd=thd@entry=0x147bd8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961 #13 0x0000563600e1867b in mysql_parse (thd=thd@entry=0x147bd8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c123c0470) at /test/10.9_dbg/sql/sql_parse.cc:8046 #14 0x0000563600e25f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147bd8000db8, packet=packet@entry=0x147bd800b699 "SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823"..., packet_length=packet_length@entry=878, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364 #15 0x0000563600e28686 in do_command (thd=0x147bd8000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408 #16 0x0000563600f85d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5636047d2638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #17 0x0000563600f8620b in handle_one_connection (arg=0x5636047d2638) at /test/10.9_dbg/sql/sql_connect.cc:1312 #18 0x0000147c2f257609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #19 0x0000147c2ee43163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Optimized)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x1502bc6a4700 (LWP 1070981))] (gdb) bt #0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518 #1 remove_const (join=0x15027c06cf90, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=0x15027c06d29c) at /test/10.9_opt/sql/sql_select.cc:14631 #2 0x0000564ef971e1ba in JOIN::optimize_stage2 (this=<optimized out>) at /test/10.9_opt/sql/sql_select.cc:2971 #3 0x0000564ef9721368 in JOIN::optimize_inner (this=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:2521 #4 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:1837 #5 0x0000564ef9687464 in st_select_lex::optimize_unflattened_subqueries (this=0x15027c010e08, const_only=const_only@entry=true) at /test/10.9_opt/sql/sql_lex.cc:4916 #6 0x0000564ef9809455 in JOIN::optimize_constant_subqueries (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/opt_subselect.cc:5622 #7 0x0000564ef971ff67 in JOIN::optimize_inner (this=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:2157 #8 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:1837 #9 0x0000564ef97237be in mysql_select (thd=0x15027c000c58, tables=0x15027c047138, fields=@0x15027c0110a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15027c0113a0, last = 0x15027c011660, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x15027c04b048, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x15027c053040, unit=0x15027c004cb8, select_lex=0x15027c010e08) at /test/10.9_opt/sql/sql_select.cc:5022 #10 0x0000564ef9723f57 in handle_select (thd=thd@entry=0x15027c000c58, lex=lex@entry=0x15027c004be0, result=result@entry=0x15027c053040, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_opt/sql/sql_select.cc:570 #11 0x0000564ef96a7a21 in execute_sqlcom_select (thd=0x15027c000c58, all_tables=0x15027c047138) at /test/10.9_opt/sql/sql_parse.cc:6271 #12 0x0000564ef96b5363 in mysql_execute_command (thd=0x15027c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:3961 #13 0x0000564ef96a2a55 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x15027c000c58) at /test/10.9_opt/sql/sql_parse.cc:8046 #14 mysql_parse (thd=0x15027c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:7968 #15 0x0000564ef96ae71a in dispatch_command (command=COM_QUERY, thd=0x15027c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.9_opt/sql/sql_class.h:1364 #16 0x0000564ef96b0642 in do_command (thd=0x15027c000c58, blocking=blocking@entry=true) at /test/10.9_opt/sql/sql_parse.cc:1408 #17 0x0000564ef97c55bf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564efb6494d8, put_in_cache=put_in_cache@entry=true) at /test/10.9_opt/sql/sql_connect.cc:1418 #18 0x0000564ef97c589d in handle_one_connection (arg=0x564efb6494d8) at /test/10.9_opt/sql/sql_connect.cc:1312 #19 0x00001502d5700609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #20 0x00001502d52ec163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt) Bug (or feature/syntax) confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt) |
Summary | Server crash in /sql/sql_select.cc:13398 in update_depend_map_for_order | SIGSEGV in update_depend_map_for_order on SELECT |
Assignee | Sergei Petrunia [ psergey ] |
Affects Version/s | 10.2 [ 14601 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.7 [ 24805 ] | |
Affects Version/s | 10.8 [ 26121 ] | |
Affects Version/s | 10.9 [ 26905 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] |
Description |
Original testcase:
{code:sql} CREATE TABLE v816 ( v817 TEXT ) ; INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; {code} Leads to: {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x147c123c1700 (LWP 1070999))] (gdb) bt #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 #1 remove_const (join=join@entry=0x147bd8096ee8, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=simple_order@entry=0x147bd80971f4) at /test/10.9_dbg/sql/sql_select.cc:14631 #2 0x0000563600eae5dd in JOIN::optimize_stage2 (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2971 #3 0x0000563600eb15a7 in JOIN::optimize_inner (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2521 #4 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:1837 #5 0x0000563600df6462 in st_select_lex::optimize_unflattened_subqueries (this=0x147bd8014328, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916 #6 0x0000563600fe2f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/opt_subselect.cc:5622 #7 0x0000563600eb0490 in JOIN::optimize_inner (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:2157 #8 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:1837 #9 0x0000563600eb1a5f in mysql_select (thd=thd@entry=0x147bd8000db8, tables=0x147bd806f580, fields=@0x147bd80145c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147bd80148c0, last = 0x147bd8014b88, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x147bd8073500, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147bd807b5d8, unit=0x147bd8004fd8, select_lex=0x147bd8014328) at /test/10.9_dbg/sql/sql_select.cc:5022 #10 0x0000563600eb22a8 in handle_select (thd=thd@entry=0x147bd8000db8, lex=lex@entry=0x147bd8004f00, result=result@entry=0x147bd807b5d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570 #11 0x0000563600e1e6c8 in execute_sqlcom_select (thd=thd@entry=0x147bd8000db8, all_tables=0x147bd806f580) at /test/10.9_dbg/sql/sql_parse.cc:6271 #12 0x0000563600e2a935 in mysql_execute_command (thd=thd@entry=0x147bd8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961 #13 0x0000563600e1867b in mysql_parse (thd=thd@entry=0x147bd8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c123c0470) at /test/10.9_dbg/sql/sql_parse.cc:8046 #14 0x0000563600e25f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147bd8000db8, packet=packet@entry=0x147bd800b699 "SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823"..., packet_length=packet_length@entry=878, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364 #15 0x0000563600e28686 in do_command (thd=0x147bd8000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408 #16 0x0000563600f85d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5636047d2638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #17 0x0000563600f8620b in handle_one_connection (arg=0x5636047d2638) at /test/10.9_dbg/sql/sql_connect.cc:1312 #18 0x0000147c2f257609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #19 0x0000147c2ee43163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Optimized)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x1502bc6a4700 (LWP 1070981))] (gdb) bt #0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518 #1 remove_const (join=0x15027c06cf90, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=0x15027c06d29c) at /test/10.9_opt/sql/sql_select.cc:14631 #2 0x0000564ef971e1ba in JOIN::optimize_stage2 (this=<optimized out>) at /test/10.9_opt/sql/sql_select.cc:2971 #3 0x0000564ef9721368 in JOIN::optimize_inner (this=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:2521 #4 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:1837 #5 0x0000564ef9687464 in st_select_lex::optimize_unflattened_subqueries (this=0x15027c010e08, const_only=const_only@entry=true) at /test/10.9_opt/sql/sql_lex.cc:4916 #6 0x0000564ef9809455 in JOIN::optimize_constant_subqueries (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/opt_subselect.cc:5622 #7 0x0000564ef971ff67 in JOIN::optimize_inner (this=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:2157 #8 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:1837 #9 0x0000564ef97237be in mysql_select (thd=0x15027c000c58, tables=0x15027c047138, fields=@0x15027c0110a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15027c0113a0, last = 0x15027c011660, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x15027c04b048, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x15027c053040, unit=0x15027c004cb8, select_lex=0x15027c010e08) at /test/10.9_opt/sql/sql_select.cc:5022 #10 0x0000564ef9723f57 in handle_select (thd=thd@entry=0x15027c000c58, lex=lex@entry=0x15027c004be0, result=result@entry=0x15027c053040, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_opt/sql/sql_select.cc:570 #11 0x0000564ef96a7a21 in execute_sqlcom_select (thd=0x15027c000c58, all_tables=0x15027c047138) at /test/10.9_opt/sql/sql_parse.cc:6271 #12 0x0000564ef96b5363 in mysql_execute_command (thd=0x15027c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:3961 #13 0x0000564ef96a2a55 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x15027c000c58) at /test/10.9_opt/sql/sql_parse.cc:8046 #14 mysql_parse (thd=0x15027c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:7968 #15 0x0000564ef96ae71a in dispatch_command (command=COM_QUERY, thd=0x15027c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.9_opt/sql/sql_class.h:1364 #16 0x0000564ef96b0642 in do_command (thd=0x15027c000c58, blocking=blocking@entry=true) at /test/10.9_opt/sql/sql_parse.cc:1408 #17 0x0000564ef97c55bf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564efb6494d8, put_in_cache=put_in_cache@entry=true) at /test/10.9_opt/sql/sql_connect.cc:1418 #18 0x0000564ef97c589d in handle_one_connection (arg=0x564efb6494d8) at /test/10.9_opt/sql/sql_connect.cc:1312 #19 0x00001502d5700609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #20 0x00001502d52ec163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt) Bug (or feature/syntax) confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt) |
Original testcase (reduced version in comments below):
{code:sql} CREATE TABLE v816 ( v817 TEXT ) ; INSERT INTO v816 ( v817 ) VALUES ( 'x' ) , ( NULL ) , ( 'x' ) , ( NULL ) ; SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823 NATURAL JOIN v816 AS v824 NATURAL JOIN v816 WINDOW v832 AS ( PARTITION BY ( v817 OR NOT v817 ) BETWEEN ( ( ( NOT ( ( ( v817 < 'x' ) ) * NULL ) ) ) ) AND 19998157.000000 ORDER BY 'x' BETWEEN ( ( ( SELECT v817 FROM v816 GROUP BY v817 WINDOW v833 AS ( PARTITION BY v817 ORDER BY ( SELECT DISTINCT 66 FROM v816 AS v829 , v816 AS v830 NATURAL JOIN v816 AS v831 JOIN v816 ) DESC RANGE BETWEEN 79934776.000000 FOLLOWING AND 41086601.000000 FOLLOWING ) ORDER BY v817 + v817 , v817 + v817 ) = 3 ) ) AND ( CASE v817 WHEN ( v817 IN ( 38 , 20 , 11 , 43 , 'x' / v817 = v817 + CASE v817 WHEN TRUE THEN -128 ELSE 99 END OR v817 = v817 OR v817 = v817 ) ) THEN 2 ELSE 2147483647 END != -128 ) ) ; {code} Leads to: {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x147c123c1700 (LWP 1070999))] (gdb) bt #0 0x0000563600e85b30 in update_depend_map_for_order (order=0x147bd8073500, join=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:14518 #1 remove_const (join=join@entry=0x147bd8096ee8, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=simple_order@entry=0x147bd80971f4) at /test/10.9_dbg/sql/sql_select.cc:14631 #2 0x0000563600eae5dd in JOIN::optimize_stage2 (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2971 #3 0x0000563600eb15a7 in JOIN::optimize_inner (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:2521 #4 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd8096ee8) at /test/10.9_dbg/sql/sql_select.cc:1837 #5 0x0000563600df6462 in st_select_lex::optimize_unflattened_subqueries (this=0x147bd8014328, const_only=const_only@entry=true) at /test/10.9_dbg/sql/sql_lex.cc:4916 #6 0x0000563600fe2f3d in JOIN::optimize_constant_subqueries (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/opt_subselect.cc:5622 #7 0x0000563600eb0490 in JOIN::optimize_inner (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:2157 #8 0x0000563600eb196c in JOIN::optimize (this=this@entry=0x147bd807b600) at /test/10.9_dbg/sql/sql_select.cc:1837 #9 0x0000563600eb1a5f in mysql_select (thd=thd@entry=0x147bd8000db8, tables=0x147bd806f580, fields=@0x147bd80145c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147bd80148c0, last = 0x147bd8014b88, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x147bd8073500, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147bd807b5d8, unit=0x147bd8004fd8, select_lex=0x147bd8014328) at /test/10.9_dbg/sql/sql_select.cc:5022 #10 0x0000563600eb22a8 in handle_select (thd=thd@entry=0x147bd8000db8, lex=lex@entry=0x147bd8004f00, result=result@entry=0x147bd807b5d8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_dbg/sql/sql_select.cc:570 #11 0x0000563600e1e6c8 in execute_sqlcom_select (thd=thd@entry=0x147bd8000db8, all_tables=0x147bd806f580) at /test/10.9_dbg/sql/sql_parse.cc:6271 #12 0x0000563600e2a935 in mysql_execute_command (thd=thd@entry=0x147bd8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:3961 #13 0x0000563600e1867b in mysql_parse (thd=thd@entry=0x147bd8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c123c0470) at /test/10.9_dbg/sql/sql_parse.cc:8046 #14 0x0000563600e25f79 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147bd8000db8, packet=packet@entry=0x147bd800b699 "SELECT v817 , 'x' / 12155613.000000 IS NOT NULL AS v818 FROM ( SELECT DISTINCT 42 FROM ( SELECT DISTINCT v817 , 'x' FROM v816 ) AS v819 , v816 AS v820 , v816 AS v821 , v816 AS v822 JOIN v816 ) AS v823"..., packet_length=packet_length@entry=878, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1364 #15 0x0000563600e28686 in do_command (thd=0x147bd8000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1408 #16 0x0000563600f85d02 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5636047d2638, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418 #17 0x0000563600f8620b in handle_one_connection (arg=0x5636047d2638) at /test/10.9_dbg/sql/sql_connect.cc:1312 #18 0x0000147c2f257609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #19 0x0000147c2ee43163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} {noformat:title=10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Optimized)} Core was generated by `/test/MD030522-mariadb-10.9.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518 14518 order->depend_map|=(*tab)->ref.depend_map; [Current thread is 1 (Thread 0x1502bc6a4700 (LWP 1070981))] (gdb) bt #0 0x0000564ef96fe3cf in update_depend_map_for_order (join=0x15027c06cf90, join=0x15027c06cf90, order=0x15027c04b048) at /test/10.9_opt/sql/sql_select.cc:14518 #1 remove_const (join=0x15027c06cf90, first_order=<optimized out>, cond=0x0, change_list=true, simple_order=0x15027c06d29c) at /test/10.9_opt/sql/sql_select.cc:14631 #2 0x0000564ef971e1ba in JOIN::optimize_stage2 (this=<optimized out>) at /test/10.9_opt/sql/sql_select.cc:2971 #3 0x0000564ef9721368 in JOIN::optimize_inner (this=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:2521 #4 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c06cf90) at /test/10.9_opt/sql/sql_select.cc:1837 #5 0x0000564ef9687464 in st_select_lex::optimize_unflattened_subqueries (this=0x15027c010e08, const_only=const_only@entry=true) at /test/10.9_opt/sql/sql_lex.cc:4916 #6 0x0000564ef9809455 in JOIN::optimize_constant_subqueries (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/opt_subselect.cc:5622 #7 0x0000564ef971ff67 in JOIN::optimize_inner (this=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:2157 #8 0x0000564ef97236d3 in JOIN::optimize (this=this@entry=0x15027c053068) at /test/10.9_opt/sql/sql_select.cc:1837 #9 0x0000564ef97237be in mysql_select (thd=0x15027c000c58, tables=0x15027c047138, fields=@0x15027c0110a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15027c0113a0, last = 0x15027c011660, elements = 2}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x15027c04b048, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x15027c053040, unit=0x15027c004cb8, select_lex=0x15027c010e08) at /test/10.9_opt/sql/sql_select.cc:5022 #10 0x0000564ef9723f57 in handle_select (thd=thd@entry=0x15027c000c58, lex=lex@entry=0x15027c004be0, result=result@entry=0x15027c053040, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.9_opt/sql/sql_select.cc:570 #11 0x0000564ef96a7a21 in execute_sqlcom_select (thd=0x15027c000c58, all_tables=0x15027c047138) at /test/10.9_opt/sql/sql_parse.cc:6271 #12 0x0000564ef96b5363 in mysql_execute_command (thd=0x15027c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:3961 #13 0x0000564ef96a2a55 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x15027c000c58) at /test/10.9_opt/sql/sql_parse.cc:8046 #14 mysql_parse (thd=0x15027c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:7968 #15 0x0000564ef96ae71a in dispatch_command (command=COM_QUERY, thd=0x15027c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.9_opt/sql/sql_class.h:1364 #16 0x0000564ef96b0642 in do_command (thd=0x15027c000c58, blocking=blocking@entry=true) at /test/10.9_opt/sql/sql_parse.cc:1408 #17 0x0000564ef97c55bf in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564efb6494d8, put_in_cache=put_in_cache@entry=true) at /test/10.9_opt/sql/sql_connect.cc:1418 #18 0x0000564ef97c589d in handle_one_connection (arg=0x564efb6494d8) at /test/10.9_opt/sql/sql_connect.cc:1312 #19 0x00001502d5700609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #20 0x00001502d52ec163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 {noformat} Bug confirmed present in: MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt) Bug (or feature/syntax) confirmed not present in: MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt) |
Summary | SIGSEGV in update_depend_map_for_order on SELECT | SIGSEGV in update_depend_map_for_order on SELECT, runtime error: member access within null pointer of type 'struct JOIN_TAB' |
Summary | SIGSEGV in update_depend_map_for_order on SELECT, runtime error: member access within null pointer of type 'struct JOIN_TAB' | SIGSEGV in update_depend_map_for_order on SELECT, UBSAN: runtime error: member access within null pointer of type 'struct JOIN_TAB' |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Security | Developers [ 10400 ] |
Labels | fuzzer | UBSAN fuzzer |
Component/s | Partitioning [ 10802 ] |
Link |
This issue is duplicated by |
Link |
This issue is duplicated by |
Link |
This issue relates to |
Fix Version/s | 10.2 [ 14601 ] |
Link |
This issue relates to |
Link |
This issue is part of |
Component/s | Parser [ 10201 ] | |
Component/s | Partitioning [ 10802 ] | |
Component/s | Server [ 13907 ] | |
Fix Version/s | 10.3.38 [ 28507 ] | |
Fix Version/s | 10.4.28 [ 28509 ] | |
Fix Version/s | 10.5.19 [ 28511 ] | |
Fix Version/s | 10.6.12 [ 28513 ] | |
Fix Version/s | 10.7.8 [ 28515 ] | |
Fix Version/s | 10.8.7 [ 28517 ] | |
Fix Version/s | 10.9.5 [ 28519 ] | |
Fix Version/s | 10.10.3 [ 28521 ] | |
Fix Version/s | 10.11.2 [ 28523 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Resolution | Fixed [ 1 ] | |
Status | Confirmed [ 10101 ] | Closed [ 6 ] |
Link |
This issue relates to |
Security | Developers [ 10400 ] |
Link |
This issue relates to |
Link | This issue relates to MDEV-30756 [ MDEV-30756 ] |