Details
Description
Run these queries in debug build:
CREATE TEMPORARY TABLE x ( x INT UNIQUE NOT NULL ) ;
INSERT INTO x ( x ) VALUES ( 1 ) ;
UPDATE x SET x = x + x WHERE ( WITH RECURSIVE x ( x ) AS ( WITH x AS ( SELECT * FROM ( WITH x AS ( SELECT * FROM x WHERE x IS NULL GROUP BY x HAVING ( SELECT 1 FROM x WHERE 1 ^ 1 = ( ( SELECT * FROM x WHERE NOT EXISTS ( SELECT 1 FROM x GROUP BY x HAVING x ) GROUP BY x , x HAVING ( ( x OR NOT x ) BETWEEN 'x' AND 1 ) + x ) = 1 OR x = 'x' OR x = 'x' AND 1.000000 BETWEEN 1 AND 1 ) > x GROUP BY 'x' , ( TRUE = ( SELECT x ) AND 1.000000 BETWEEN 1 AND 1 ) = 1 , 'x' , 1 , ( SELECT x FROM x WHERE ( ( WITH RECURSIVE x ( x ) AS ( SELECT 1 UNION SELECT 1 - x FROM x ) SELECT x WHERE x = ( x = 1 OR FALSE > 'x' ) ) ) AND x IS NOT NULL GROUP BY x ORDER BY x + x , x + x ) ) AND x = 1 ORDER BY x ) SELECT ( ( TRUE = ( SELECT x + x LIKE x FROM x WHERE 1 * ( x LIKE 1 + 1 / 1 + NULL - x ) IN ( SELECT x AS x FROM x AS x WHERE ( SELECT x FROM x WHERE x = x GROUP BY x IN ( x NOT LIKE ( SELECT x ) + x IS NOT NULL ) AND x IN ( NULL , NOT ( NOT ( 'x' = 'x' AND 1 IN ( 1 , 1 ) ) ) ) AND x = 1 ORDER BY x , x DESC , x ASC ) IN ( SELECT x WHERE x = x OR ( x = 1 AND x = 1 ) ORDER BY ( SELECT x FROM x WHERE x > 1 OR x = 1 OR x = 'x' GROUP BY x IN ( 1 , 1 ) HAVING x ORDER BY 1 ) ) ) WINDOW x AS ( PARTITION BY x ORDER BY x DESC ) ORDER BY ( x = 1 AND x = 1 ) DESC ) AND 1.000000 BETWEEN 1 AND 1 ) BETWEEN 1 AND 1 ) + x FROM x WINDOW x AS ( PARTITION BY x ORDER BY x DESC ) ) AS x ORDER BY 'x' , 'x' ) SELECT 1 INTERSECT SELECT x + 1 FROM x ) SELECT x AS x FROM x AS x GROUP BY x HAVING x ) ;
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 0x00005555575bb678 in Field_iterator_table_ref::set_field_iterator (this=0x7fffd1929160) at /home/wx/mariadb-11.3.0/sql/table.cc:7207
#5 0x00005555575bbb54 in Field_iterator_table_ref::set (this=0x7fffd1929160, table=0x62d000083400) at /home/wx/mariadb-11.3.0/sql/table.cc:7224
#6 0x00005555570269bb in insert_fields (thd=0x62c0001e0288, context=0x6290000f6d50, db_name_arg=..., table_name=..., it=0x7fffd1929680, any_privileges=false, hidden_bit_fields=0x6290000f70f8, returning_field=false) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:8601
#7 0x0000555557021bcb in setup_wild (thd=0x62c0001e0288, tables=0x62d000083400, fields=..., sum_func_list=0x63100007c958, select_lex=0x6290000f6d08, returning_field=false) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:7954
#8 0x00005555572b6223 in JOIN::prepare (this=0x63100007c5a8, tables_init=0x62d000083400, conds_init=0x0, og_num=2, order_init=0x62d000084448, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x6290000f6d08, unit_arg=0x62d000083b48) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1505
#9 0x000055555751de5d in st_select_lex_unit::prepare_join (this=0x62d000083b48, thd_arg=0x62c0001e0288, sl=0x6290000f6d08, tmp_result=0x631000074560, additional_options=0, is_union_select=false) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1103
#10 0x0000555557521de1 in st_select_lex_unit::prepare (this=0x62d000083b48, derived_arg=0x62d000085ca0, sel_result=0x631000074560, additional_options=0) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1583
#11 0x00005555570d64f9 in mysql_derived_prepare (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62d000085ca0) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:840
#12 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x62d000085ca0, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#13 0x00005555575ce965 in TABLE_LIST::handle_derived (this=0x62d000085ca0, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9651
#14 0x000055555711d7d6 in LEX::handle_list_of_derived (this=0x62c0001e45f8, table_list=0x62d000085ca0, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#15 0x0000555557143da1 in st_select_lex::handle_derived (this=0x62d0000854c8, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#16 0x00005555572b563d in JOIN::prepare (this=0x63100007bfa0, tables_init=0x62d000085ca0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=true, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62d0000854c8, unit_arg=0x62d000084c88) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1439
#17 0x000055555751de5d in st_select_lex_unit::prepare_join (this=0x62d000084c88, thd_arg=0x62c0001e0288, sl=0x62d0000854c8, tmp_result=0x631000074388, additional_options=0, is_union_select=true) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1103
#18 0x00005555575228cc in st_select_lex_unit::prepare (this=0x62d000084c88, derived_arg=0x6290000f7a38, sel_result=0x631000074290, additional_options=0) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1659
#19 0x00005555570d64f9 in mysql_derived_prepare (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x6290000f7a38) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:840
#20 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x6290000f7a38, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#21 0x00005555575ce965 in TABLE_LIST::handle_derived (this=0x6290000f7a38, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9651
#22 0x000055555711d7d6 in LEX::handle_list_of_derived (this=0x62c0001e45f8, table_list=0x6290000f7a38, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#23 0x0000555557143da1 in st_select_lex::handle_derived (this=0x6290000f73e0, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#24 0x00005555575ce8d7 in TABLE_LIST::handle_derived (this=0x62d00006ec68, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9648
#25 0x000055555711d7d6 in LEX::handle_list_of_derived (this=0x62c0001e45f8, table_list=0x62d00006ec68, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#26 0x0000555557143da1 in st_select_lex::handle_derived (this=0x62d00006e4a8, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#27 0x00005555572b563d in JOIN::prepare (this=0x63100007b998, tables_init=0x62d00006ec68, conds_init=0x62d00007d7f8, og_num=1, order_init=0x62d00007f070, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62d00006e4a8, unit_arg=0x62d00007dec8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1439
#28 0x0000555557dcc18e in subselect_single_select_engine::prepare (this=0x62d00007f2a8, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:3943
#29 0x0000555557da5ca5 in Item_subselect::fix_fields (this=0x62d00007f108, thd_param=0x62c0001e0288, ref=0x62d00007f378) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:296
#30 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x62d00007f108, thd=0x62c0001e0288, ref=0x62d00007f378) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#31 0x0000555557c6c9f2 in Item_func::fix_fields (this=0x62d00007f2f0, thd=0x62c0001e0288, ref=0x62d00007f9a8) at /home/wx/mariadb-11.3.0/sql/item_func.cc:349
#32 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x62d00007f2f0, thd=0x62c0001e0288, ref=0x62d00007f9a8) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#33 0x0000555556f04089 in Item::fix_fields_if_needed_for_scalar (this=0x62d00007f2f0, thd=0x62c0001e0288, ref=0x62d00007f9a8) at /home/wx/mariadb-11.3.0/sql/item.h:1156
#34 0x000055555703235b in Item::fix_fields_if_needed_for_bool (this=0x62d00007f2f0, thd=0x62c0001e0288, ref=0x62d00007f9a8) at /home/wx/mariadb-11.3.0/sql/item.h:1160
#35 0x0000555557c13a3b in Item_cond::fix_fields (this=0x62d00007f898, thd=0x62c0001e0288, ref=0x62d00007fc40) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:4941
#36 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x62d00007f898, thd=0x62c0001e0288, ref=0x62d00007fc40) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#37 0x0000555557c6c9f2 in Item_func::fix_fields (this=0x62d00007fb00, thd=0x62c0001e0288, ref=0x62d00007fe18) at /home/wx/mariadb-11.3.0/sql/item_func.cc:349
#38 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x62d00007fb00, thd=0x62c0001e0288, ref=0x62d00007fe18) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#39 0x0000555557c6c9f2 in Item_func::fix_fields (this=0x62d00007fd98, thd=0x62c0001e0288, ref=0x62d00007fe60) at /home/wx/mariadb-11.3.0/sql/item_func.cc:349
#40 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x62d00007fd98, thd=0x62c0001e0288, ref=0x62d00007fe60) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#41 0x0000555556f04089 in Item::fix_fields_if_needed_for_scalar (this=0x62d00007fd98, thd=0x62c0001e0288, ref=0x62d00007fe60) at /home/wx/mariadb-11.3.0/sql/item.h:1156
#42 0x0000555557022e20 in setup_fields (thd=0x62c0001e0288, ref_pointer_array=..., fields=..., column_usage=MARK_COLUMNS_READ, sum_func_list=0x631000074008, pre_fix=0x62900015cc08, allow_sum_func=true) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:8061
#43 0x00005555572b6835 in JOIN::prepare (this=0x631000073c58, tables_init=0x62d0000824a8, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62900015c938, unit_arg=0x62d000082bc0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1526
#44 0x000055555751de5d in st_select_lex_unit::prepare_join (this=0x62d000082bc0, thd_arg=0x62c0001e0288, sl=0x62900015c938, tmp_result=0x631000073b60, additional_options=0, is_union_select=false) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1103
#45 0x0000555557521de1 in st_select_lex_unit::prepare (this=0x62d000082bc0, derived_arg=0x62d000083400, sel_result=0x631000073b60, additional_options=0) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1583
#46 0x00005555570d64f9 in mysql_derived_prepare (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62d000083400) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:840
#47 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x62d000083400, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#48 0x00005555575ce965 in TABLE_LIST::handle_derived (this=0x62d000083400, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9651
#49 0x000055555711d7d6 in LEX::handle_list_of_derived (this=0x62c0001e45f8, table_list=0x62d000083400, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#50 0x0000555557143da1 in st_select_lex::handle_derived (this=0x6290000f6d08, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#51 0x00005555575ce8d7 in TABLE_LIST::handle_derived (this=0x62d000085ca0, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9648
#52 0x000055555711d7d6 in LEX::handle_list_of_derived (this=0x62c0001e45f8, table_list=0x62d000085ca0, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#53 0x0000555557143da1 in st_select_lex::handle_derived (this=0x62d0000854c8, lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#54 0x00005555570d5e42 in mysql_derived_prepare (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62d000087050) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:794
#55 0x00005555570d1f76 in mysql_handle_derived (lex=0x62c0001e45f8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:123
#56 0x0000555557559f43 in Multiupdate_prelocking_strategy::handle_end (this=0x6290000f6b08, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_update.cc:1549
#57 0x000055555700f2c2 in open_tables (thd=0x62c0001e0288, options=..., start=0x7fffd192d6a0, counter=0x6290000f6ae8, flags=0, prelocking_strategy=0x6290000f6b08) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:4747
#58 0x0000555556ff5627 in open_tables (thd=0x62c0001e0288, tables=0x7fffd192d6a0, counter=0x6290000f6ae8, flags=0, prelocking_strategy=0x6290000f6b08) at /home/wx/mariadb-11.3.0/sql/sql_base.h:267
#59 0x0000555557014b86 in open_tables_for_query (thd=0x62c0001e0288, tables=0x6290000f5ef8, table_count=0x6290000f6ae8, flags=0, prelocking_strategy=0x6290000f6b08) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:5746
#60 0x00005555573a791a in Sql_cmd_dml::prepare (this=0x6290000f6ad0, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33256
#61 0x00005555573a7c66 in Sql_cmd_dml::execute (this=0x6290000f6ad0, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33318
#62 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
#63 0x00005555571d95e2 in mysql_parse (thd=0x62c0001e0288, rawbuf=0x6290000f52a8 "UPDATE x SET x = x + x WHERE ( WITH RECURSIVE x ( x ) AS ( WITH x AS ( SELECT * FROM ( WITH x AS ( SELECT * FROM x WHERE x IS NULL GROUP BY x HAVING ( SELECT 1 FROM x WHERE 1 ^ 1 = ( ( SELECT * FROM x"..., length=1471, parser_state=0x7fffd192e870) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#64 0x00005555571b1237 in dispatch_command (command=COM_QUERY, thd=0x62c0001e0288, packet=0x6290000fa289 " UPDATE x SET x = x + x WHERE ( WITH RECURSIVE x ( x ) AS ( WITH x AS ( SELECT * FROM ( WITH x AS ( SELECT * FROM x WHERE x IS NULL GROUP BY x HAVING ( SELECT 1 FROM x WHERE 1 ^ 1 = ( ( SELECT * FROM "..., packet_length=1475, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#65 0x00005555571adf7c in do_command (thd=0x62c0001e0288, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#66 0x000055555768e557 in do_handle_one_connection (connect=0x61100004b348, put_in_cache=true) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#67 0x000055555768deb4 in handle_one_connection (arg=0x61100004b208) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#68 0x00005555582fa350 in pfs_spawn_thread (arg=0x618000005508) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#69 0x00007ffff7115609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#70 0x00007ffff6ce8133 in clone () from /lib/x86_64-linux-gnu/libc.so.6