Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.3.0, 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2
-
None
-
Ubuntu 20.04
Description
Run these queries in debug build:
CREATE TABLE x ( x INT ) ;
INSERT INTO x ( x ) VALUES ( 1 ) ;
UPDATE x SET x = 1 WHERE x IN ( SELECT EXISTS ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT 1 FROM x GROUP BY x , x HAVING ( 1 = 1 AND ( x = 1 ) = 1 ) INTERSECT SELECT x + 1 FROM ( SELECT x FROM x UNION SELECT 'x' FROM x ORDER BY x IN ( SELECT DISTINCT x FROM x WHERE x = ( EXISTS ( SELECT * FROM x WHERE x = x GROUP BY x IN ( SELECT DISTINCT x NOT LIKE 'x' FROM x WHERE x = x + 1 ) , 'x' , 'x' HAVING ( 1 = 1 AND CASE 1 WHEN NOT x != 1 THEN 1.000000 WHEN NOT EXISTS ( WITH RECURSIVE x ( x ) AS ( SELECT 1 ) SELECT 1 FROM x ) THEN 'x' ELSE ( ( CASE 1 WHEN ( x < 1 OR x > 1 ) AND x % 1 = 1 AND x IS NOT NULL THEN ( - x ) WHEN 1 THEN 'x' WHEN 'x' THEN 1 WHEN 'x' THEN 'x' WHEN 'x' THEN 'x' ELSE 1 / 1 END - ( SELECT x > 1.000000 ) NOT IN ( SELECT 1 FROM ( SELECT x FROM x UNION SELECT x FROM x ORDER BY 1.000000 * 1 ) AS x WHERE ( x = 'x' OR x = 'x' ) AND x IS NOT NULL GROUP BY x ) AND ( ( x , x ) > ( 'x' , 'x' ) AND x NOT BETWEEN 'x' AND 1.000000 ^ ( 1.000000 ) ) IS NOT NULL ) NOT LIKE CASE WHEN x >= 1 THEN ( - x ) ELSE ( 1 * x ) END OR x = x ) END <= CASE WHEN x = 1 THEN 'x' ELSE EXISTS ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT 1 FROM x GROUP BY x , x HAVING ( 1 = 1 AND ( x = 1 ) = 1 ) INTERSECT SELECT x + 1 FROM ( SELECT x FROM x UNION SELECT 'x' FROM x ) AS x ) SELECT * FROM x WHERE x = x ) END ) ) OR x > 'x' ) NOT LIKE 'x' ) , x ASC ) AS x ) SELECT * FROM x WHERE x = x ) AS x FROM x UNION SELECT x + 1 FROM x ) ORDER BY x * 1 ;
Will trigger Assertion Failed.
GDB info:
#0 0x00007ffff6c0c00b in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff6beb859 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff6beb729 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff6bfcfd6 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00005555575147d2 in select_unit::change_select (this=0x62d0001229c0)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:74
#5 0x000055555752918d in st_select_lex_unit::exec_inner (this=0x629000156318)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2341
#6 0x0000555557528545 in st_select_lex_unit::exec (this=0x629000156318)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2292
#7 0x00005555570d9898 in mysql_derived_fill (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62d0001193d0)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1256
#8 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x62d0001193d0, phases=96)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#9 0x000055555732a50c in st_join_table::preread_init (this=0x62f000024098)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16029
#10 0x000055555735f8c8 in sub_select (join=0x62d00011fe78, join_tab=0x62f000024098, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23392
#11 0x000055555735dadd in do_select (join=0x62d00011fe78, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#12 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62d00011fe78) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#13 0x00005555572d93a0 in JOIN::exec (this=0x62d00011fe78) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#14 0x000055555752c2cf in st_select_lex_unit::exec_recursive (this=0x6290000f7520)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2618
#15 0x00005555570d8d53 in TABLE_LIST::fill_recursive (this=0x629000159758, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1155
#16 0x00005555570d986b in mysql_derived_fill (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x629000159758)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1250
#17 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x629000159758, phases=96)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#18 0x000055555732a50c in st_join_table::preread_init (this=0x63100008ca38)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16029
#19 0x000055555735f8c8 in sub_select (join=0x62d000126a58, join_tab=0x63100008ca38, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23392
#20 0x000055555735dadd in do_select (join=0x62d000126a58, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#21 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62d000126a58) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#22 0x00005555572d93a0 in JOIN::exec (this=0x62d000126a58) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#23 0x0000555557dce72f in subselect_single_select_engine::exec (this=0x62d000116430)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4159
#24 0x0000555557da9c85 in Item_subselect::exec (this=0x62d000118f20)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
#25 0x0000555557dab291 in Item_in_subselect::exec (this=0x62d000118f20)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:994
#26 0x0000555557db650f in Item_in_subselect::val_bool (this=0x62d000118f20)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1991
#27 0x0000555556e14cd4 in Item::val_bool_result (this=0x62d000118f20) at /home/wx/mariadb-11.3.0/sql/item.h:1797
#28 0x0000555557bf3f02 in Item_in_optimizer::val_int (this=0x62f000011f30)
at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1664
#29 0x0000555556e14b78 in Item::val_int_result (this=0x62f000011f30) at /home/wx/mariadb-11.3.0/sql/item.h:1793
#30 0x0000555557bc30d8 in Item_cache_int::cache_value (this=0x6310000bc508)
at /home/wx/mariadb-11.3.0/sql/item.cc:10161
#31 0x0000555557bdad9f in Item_cache_wrapper::cache (this=0x6310000bc458) at /home/wx/mariadb-11.3.0/sql/item.cc:8915
#32 0x0000555557bb7dac in Item_cache_wrapper::save_val (this=0x6310000bc458, to=0x61a0001ddd28)
at /home/wx/mariadb-11.3.0/sql/item.cc:8941
#33 0x0000555557bd1043 in Item_cache_wrapper::save_in_result_field (this=0x6310000bc458)
at /home/wx/mariadb-11.3.0/sql/item.h:5958
#34 0x00005555573879d1 in copy_funcs (func_ptr=0x620000041b78, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:28843
#35 0x000055555736c428 in end_write (join=0x62d000124898, join_tab=0x62f0000330c8, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24979
#36 0x00005555573a1a77 in AGGR_OP::put_record (this=0x6310000bc8d8, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:32254
#37 0x00005555573b632d in AGGR_OP::put_record (this=0x6310000bc8d8) at /home/wx/mariadb-11.3.0/sql/sql_select.h:1180
#38 0x000055555735ec6a in sub_select_postjoin_aggr (join=0x62d000124898, join_tab=0x62f0000330c8,
end_of_records=false) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23134
#39 0x000055555736194d in evaluate_join_record (join=0x62d000124898, join_tab=0x62f000032c50, error=0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23677
#40 0x00005555573601c2 in sub_select (join=0x62d000124898, join_tab=0x62f000032c50, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23444
#41 0x000055555735dadd in do_select (join=0x62d000124898, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#42 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62d000124898) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#43 0x00005555572d93a0 in JOIN::exec (this=0x62d000124898) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#44 0x00005555572ddbab in mysql_select (thd=0x62c0001e0288, tables=0x629000156360, fields=..., conds=0x0, og_num=2,
order=0x62d000119148, group=0x0, having=0x0, proc_param=0x0, select_options=2199023255552,
result=0x62d0001228c8, unit=0x629000156318, select_lex=0x629000157858)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5249
#45 0x000055555752ae77 in st_select_lex_unit::exec_inner (this=0x629000156318)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2480
#46 0x0000555557528545 in st_select_lex_unit::exec (this=0x629000156318)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2292
#47 0x00005555570d9898 in mysql_derived_fill (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62d0001193d0)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1256
#48 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x62d0001193d0, phases=96)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#49 0x000055555732a50c in st_join_table::preread_init (this=0x62f000024098)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16029
#50 0x000055555735f8c8 in sub_select (join=0x62d00011fe78, join_tab=0x62f000024098, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23392
#51 0x000055555735dadd in do_select (join=0x62d00011fe78, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#52 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62d00011fe78) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#53 0x00005555572d93a0 in JOIN::exec (this=0x62d00011fe78) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#54 0x000055555752c2cf in st_select_lex_unit::exec_recursive (this=0x6290000f7520)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2618
#55 0x00005555570d8d53 in TABLE_LIST::fill_recursive (this=0x62d00011a270, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1155
#56 0x00005555570d986b in mysql_derived_fill (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62d00011a270)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1250
#57 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x62d00011a270, phases=96)
at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#58 0x000055555732a50c in st_join_table::preread_init (this=0x62f000026fa8)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16029
#59 0x000055555735f8c8 in sub_select (join=0x62f000013a98, join_tab=0x62f000026fa8, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23392
#60 0x000055555735dadd in do_select (join=0x62f000013a98, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#61 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f000013a98) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#62 0x00005555572d93a0 in JOIN::exec (this=0x62f000013a98) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#63 0x0000555557dce72f in subselect_single_select_engine::exec (this=0x62d00011b858)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4159
#64 0x0000555557da9c85 in Item_subselect::exec (this=0x62d00011b6a0)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
#65 0x0000555557db45c3 in Item_exists_subselect::val_int (this=0x62d00011b6a0)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1840
#66 0x0000555557beca8a in Arg_comparator::compare_int_signed (this=0x62f00002b980)
at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:947
#67 0x0000555557c2e1d4 in Arg_comparator::compare (this=0x62f00002b980)
at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:104
#68 0x0000555557bf5bdb in Item_func_eq::val_int (this=0x62f00002b8c8)
at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1780
#69 0x000055555735da68 in do_select (join=0x62f000013340, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22958
#70 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f000013340) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#71 0x00005555572d93a0 in JOIN::exec (this=0x62f000013340) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#72 0x0000555557529ad1 in st_select_lex_unit::exec_inner (this=0x62d00011c070)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2389
#73 0x0000555557528545 in st_select_lex_unit::exec (this=0x62d00011c070)
at /home/wx/mariadb-11.3.0/sql/sql_union.cc:2292
#74 0x0000555557dcefe5 in subselect_union_engine::exec (this=0x62d00011dec0)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4187
#75 0x0000555557da9c85 in Item_subselect::exec (this=0x62d00011dc80)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
#76 0x0000555557dab291 in Item_in_subselect::exec (this=0x62d00011dc80)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:994
#77 0x0000555557db650f in Item_in_subselect::val_bool (this=0x62d00011dc80)
at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1991
#78 0x0000555556e14cd4 in Item::val_bool_result (this=0x62d00011dc80) at /home/wx/mariadb-11.3.0/sql/item.h:1797
#79 0x0000555557bf3f02 in Item_in_optimizer::val_int (this=0x62f000014958)
at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1664
#80 0x00005555570d0aa1 in SQL_SELECT::skip_record (this=0x62f000018f18, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/opt_range.h:1914
#81 0x0000555557aff70e in find_all_keys (thd=0x62c0001e0288, param=0x7fffd162a830, select=0x62f000018f18,
fs_info=0x6150000c2e00, buffpek_pointers=0x7fffd162ab30, tempfile=0x7fffd162a980, pq=0x0,
found_rows=0x6150000c2ff0) at /home/wx/mariadb-11.3.0/sql/filesort.cc:1004
#82 0x0000555557afab66 in filesort (thd=0x62c0001e0288, table=0x61900008b708, filesort=0x62f000030fa0,
tracker=0x62f000031748, join=0x62f0000129b8, first_table_bit=1) at /home/wx/mariadb-11.3.0/sql/filesort.cc:408
#83 0x00005555573791c3 in create_sort_index (thd=0x62c0001e0288, join=0x62f0000129b8, tab=0x62f000017d18,
fsort=0x62f000030fa0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:26843
#84 0x00005555573677dd in st_join_table::sort_table (this=0x62f000017d18)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24485
#85 0x0000555557366bdc in join_init_read_record (tab=0x62f000017d18)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24405
#86 0x0000555557360006 in sub_select (join=0x62f0000129b8, join_tab=0x62f000017d18, end_of_records=false)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23441
#87 0x000055555735dadd in do_select (join=0x62f0000129b8, procedure=0x0)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#88 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f0000129b8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#89 0x00005555572d93a0 in JOIN::exec (this=0x62f0000129b8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#90 0x00005555573a840c in Sql_cmd_dml::execute_inner (this=0x6290000f6828, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33413
#91 0x0000555557569d49 in Sql_cmd_update::execute_inner (this=0x6290000f6828, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/sql_update.cc:3069
#92 0x00005555573a7f0d in Sql_cmd_dml::execute (this=0x6290000f6828, thd=0x62c0001e0288)
at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33350
#93 0x00005555571c1637 in mysql_execute_command (thd=0x62c0001e0288, is_called_from_prepared_stmt=false)
at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:4361
#94 0x00005555571d95e2 in mysql_parse (thd=0x62c0001e0288,
rawbuf=0x6290000f52a8 "UPDATE x SET x = 1 WHERE x IN ( SELECT EXISTS ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT 1 FROM x GROUP BY x , x HAVING ( 1 = 1 AND ( x = 1 ) = 1 ) INTERSECT SELECT x + 1 FROM ( SELECT x "...,
length=1463, parser_state=0x7fffd162c870) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#95 0x00005555571b1237 in dispatch_command (command=COM_QUERY, thd=0x62c0001e0288,
packet=0x6290000eb289 "UPDATE x SET x = 1 WHERE x IN ( SELECT EXISTS ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT 1 FROM x GROUP BY x , x HAVING ( 1 = 1 AND ( x = 1 ) = 1 ) INTERSECT SELECT x + 1 FROM ( SELECT x "...,
packet_length=1463, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#96 0x00005555571adf7c in do_command (thd=0x62c0001e0288, blocking=true)
at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#97 0x000055555768e557 in do_handle_one_connection (connect=0x611000049908, put_in_cache=true)
at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#98 0x000055555768deb4 in handle_one_connection (arg=0x611000049908)
at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#99 0x00005555582fa350 in pfs_spawn_thread (arg=0x618000005108)
at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#100 0x00007ffff7115609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#101 0x00007ffff6ce8133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
Attachments
Issue Links
- relates to
-
MDEV-32431 Segmentation fault at /mariadb-11.3.0/sql/sql_select.cc:23355
- Confirmed