Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
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(EOL)
-
None
-
Ubuntu 20.04
Description
Run these queries in debug build:
CREATE TABLE x ( x INT UNIQUE ) ;
INSERT INTO x ( x ) VALUES ( 1 ) ;
UPDATE x SET x = 1 WHERE ( SELECT x AS x FROM x AS x WHERE x BETWEEN ( SELECT x AS x FROM x AS x GROUP BY x HAVING x ORDER BY 1 DESC ) AND 1 GROUP BY x HAVING x ) IN ( SELECT DISTINCT x WHERE x BETWEEN ( SELECT x AS x FROM x AS x GROUP BY x HAVING ( SELECT 1 FROM ( SELECT x FROM x WHERE x IN ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT x + 1 FROM x ) SELECT x WHERE x OR x GROUP BY x HAVING ( 1 = 1 AND x = 1 ) ) GROUP BY x , x HAVING ( 1 = 1 AND ( ( SELECT ( NOT ( ( SELECT 1 WHERE x != ( SELECT 1 FROM x WHERE x OR x = ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT x + 1 FROM ( WITH x AS ( SELECT DISTINCT x FROM x WHERE x BETWEEN ( SELECT 'x' / 1.000000 IS NOT NULL > x AS x ) AND 1 OR x BETWEEN 'x' AND 'x' ) SELECT x FROM x UNION SELECT x FROM x ) AS x ) SELECT x WHERE x > 1 OR x > 1 OR ( x = 1 AND ( x = x OR x = x ) ) OR ( x = 1 AND x = 1 ) ) ) ) ) ) WHERE x = x ) ) = 1 ) WINDOW x AS ( PARTITION BY x ORDER BY ( x , x ) NOT IN ( SELECT 'x' , x FROM x WHERE x > 1 ) DESC ) UNION SELECT x FROM x ) AS x WHERE 'x' = x OR x = x ) ) AND 1 ) ORDER BY x , x DESC ;
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 0x0000555557b356b9 in handler::ha_index_last (this=0x61d000258b28, buf=0x61a0006d0938 "\377") at /home/wx/mariadb-11.3.0/sql/handler.cc:3785
#5 0x0000555557368a65 in join_read_last (tab=0x62f00000f348) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24550
#6 0x0000555557360006 in sub_select (join=0x62f000006638, join_tab=0x62f00000f348, end_of_records=false) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23441
#7 0x000055555735dadd in do_select (join=0x62f000006638, procedure=0x0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
#8 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f000006638) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
#9 0x00005555572d93a0 in JOIN::exec (this=0x62f000006638) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
#10 0x0000555557dce72f in subselect_single_select_engine::exec (this=0x6290000f91d8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4159
#11 0x0000555557da9c85 in Item_subselect::exec (this=0x62900016d2a8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
#12 0x0000555557dafbe9 in Item_singlerow_subselect::val_int (this=0x62900016d2a8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1462
#13 0x0000555557ba521f in Item::save_int_in_field (this=0x62900016d2a8, field=0x61a0006d0408, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/item.cc:6843
#14 0x00005555578b2242 in Type_handler_int_result::Item_save_in_field (this=0x55555b7b6980 <type_handler_slong>, item=0x62900016d2a8, field=0x61a0006d0408, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/sql_type.cc:4341
#15 0x0000555557ba540b in Item::save_in_field (this=0x62900016d2a8, field=0x61a0006d0408, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/item.cc:6853
#16 0x0000555557b79bc4 in Item::save_in_field_no_warnings (this=0x62900016d2a8, field=0x61a0006d0408, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/item.cc:1512
#17 0x0000555556e6a59e in Field::get_mm_leaf_int (this=0x61a0006d0408, prm=0x7fffd1119a20, key_part=0x62100015a5a8, cond=0x62900016d498, op=SCALAR_CMP_GE, value=0x62900016d2a8, unsigned_field=false) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:9248
#18 0x000055555764db87 in Field_int::get_mm_leaf (this=0x61a0006d0408, param=0x7fffd1119a20, key_part=0x62100015a5a8, cond=0x62900016d498, op=SCALAR_CMP_GE, value=0x62900016d2a8) at /home/wx/mariadb-11.3.0/sql/field.h:2550
#19 0x0000555556e68904 in Item_bool_func::get_mm_leaf (this=0x62900016d498, param=0x7fffd1119a20, field=0x61a0006d0408, key_part=0x62100015a5a8, functype=Item_func::GE_FUNC, value=0x62900016d2a8) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:9091
#20 0x0000555556e66b65 in Item_bool_func::get_mm_parts (this=0x62900016d498, param=0x7fffd1119a20, field=0x61a0006d0408, type=Item_func::GE_FUNC, value=0x62900016d2a8) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:8926
#21 0x0000555556e5fd5b in Item_func_between::get_func_mm_tree (this=0x62900016d498, param=0x7fffd1119a20, field=0x61a0006d0408, value=0x0) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:8070
#22 0x0000555556e6343e in Item_bool_func::get_full_func_mm_tree (this=0x62900016d498, param=0x7fffd1119a20, field_item=0x6290000f7380, value=0x0) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:8585
#23 0x0000555556e65059 in Item_func_between::get_mm_tree (this=0x62900016d498, param=0x7fffd1119a20, cond_ptr=0x62f000011d38) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:8774
#24 0x0000555556e3e8cc in SQL_SELECT::test_quick_select (this=0x62f000011d30, thd=0x62c0001e0288, keys_to_use=..., prev_tables=0, limit=18446744073709551615, force_quick_range=false, ordered_output=false, remove_false_parts_of_where=true, only_single_index_range_scan=false) at /home/wx/mariadb-11.3.0/sql/opt_range.cc:2923
#25 0x00005555572de278 in get_quick_record_count (thd=0x62c0001e0288, select=0x62f000011d30, table=0x619000095708, keys=0x62f000010828, limit=18446744073709551615) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5293
#26 0x00005555572e578d in make_join_statistics (join=0x62f000005d50, tables_list=..., keyuse_array=0x62f0000060b8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:6060
#27 0x00005555572c2c36 in JOIN::optimize_inner (this=0x62f000005d50) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2624
#28 0x00005555572bbba6 in JOIN::optimize (this=0x62f000005d50) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
#29 0x0000555557dcd491 in subselect_single_select_engine::exec (this=0x62900016e520) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4075
#30 0x0000555557da9c85 in Item_subselect::exec (this=0x62900016e380) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
#31 0x0000555557dafbe9 in Item_singlerow_subselect::val_int (this=0x62900016e380) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1462
#32 0x0000555556e14b78 in Item::val_int_result (this=0x62900016e380) at /home/wx/mariadb-11.3.0/sql/item.h:1793
#33 0x0000555557bc30d8 in Item_cache_int::cache_value (this=0x62f00000b8b0) at /home/wx/mariadb-11.3.0/sql/item.cc:10161
#34 0x0000555557bf1836 in Item_in_optimizer::fix_left (this=0x62f00000b7d8, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1362
#35 0x0000555557dc7a5f in Item_in_subselect::select_in_like_transformer (this=0x62d00007fa78, join=0x62f000006ff8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:3476
#36 0x0000555557dc031f in Item_in_subselect::select_transformer (this=0x62d00007fa78, join=0x62f000006ff8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:2774
#37 0x0000555557791050 in check_and_do_in_subquery_rewrites (join=0x62f000006ff8) at /home/wx/mariadb-11.3.0/sql/opt_subselect.cc:794
#38 0x00005555572b7f1c in JOIN::prepare (this=0x62f000006ff8, tables_init=0x0, conds_init=0x62d00007f0c0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62900016e568, unit_arg=0x62d00007f238) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1631
#39 0x0000555557dcc18e in subselect_single_select_engine::prepare (this=0x62d00007fcb8, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:3943
#40 0x0000555557da5ca5 in Item_subselect::fix_fields (this=0x62d00007fa78, thd_param=0x62c0001e0288, ref=0x62f000004568) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:296
#41 0x0000555557dc8ea7 in Item_in_subselect::fix_fields (this=0x62d00007fa78, thd_arg=0x62c0001e0288, ref=0x62f000004568) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:3602
#42 0x0000555556f0404f in Item::fix_fields_if_needed (this=0x62d00007fa78, thd=0x62c0001e0288, ref=0x62f000004568) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#43 0x0000555556f04089 in Item::fix_fields_if_needed_for_scalar (this=0x62d00007fa78, thd=0x62c0001e0288, ref=0x62f000004568) at /home/wx/mariadb-11.3.0/sql/item.h:1156
#44 0x000055555703235b in Item::fix_fields_if_needed_for_bool (this=0x62d00007fa78, thd=0x62c0001e0288, ref=0x62f000004568) at /home/wx/mariadb-11.3.0/sql/item.h:1160
#45 0x0000555557029190 in setup_conds (thd=0x62c0001e0288, tables=0x6290000f5bf8, leaves=..., conds=0x62f000004568) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:8888
#46 0x00005555572af1c9 in setup_without_group (thd=0x62c0001e0288, ref_pointer_array=..., tables=0x6290000f5bf8, leaves=..., fields=..., all_fields=..., conds=0x62f000004568, order=0x62d00007fe58, group=0x0, win_specs=..., win_funcs=..., hidden_group_fields=0x62f00000442f, reserved=0x62c0001e52fc) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:931
#47 0x00005555572b6b86 in JOIN::prepare (this=0x62f0000040d0, tables_init=0x6290000f5bf8, conds_init=0x62d00007fa78, og_num=2, order_init=0x62d00007fe58, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x62c0001e4f10, unit_arg=0x62c0001e46d8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1531
#48 0x0000555557569318 in Sql_cmd_update::prepare_inner (this=0x6290000f6538, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_update.cc:2999
#49 0x00005555573a79a7 in Sql_cmd_dml::prepare (this=0x6290000f6538, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33265
#50 0x00005555573a7c66 in Sql_cmd_dml::execute (this=0x6290000f6538, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33318
#51 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
#52 0x00005555571d95e2 in mysql_parse (thd=0x62c0001e0288, rawbuf=0x6290000f52a8 "UPDATE x SET x = 1 WHERE ( SELECT x AS x FROM x AS x WHERE x BETWEEN ( SELECT x AS x FROM x AS x GROUP BY x HAVING x ORDER BY 1 DESC ) AND 1 GROUP BY x HAVING x ) IN ( SELECT DISTINCT x WHERE x BETWEE"..., length=1087, parser_state=0x7fffd111d870) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#53 0x00005555571b1237 in dispatch_command (command=COM_QUERY, thd=0x62c0001e0288, packet=0x6290000fa289 " UPDATE x SET x = 1 WHERE ( SELECT x AS x FROM x AS x WHERE x BETWEEN ( SELECT x AS x FROM x AS x GROUP BY x HAVING x ORDER BY 1 DESC ) AND 1 GROUP BY x HAVING x ) IN ( SELECT DISTINCT x WHERE x BETWE"..., packet_length=1091, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#54 0x00005555571adf7c in do_command (thd=0x62c0001e0288, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#55 0x000055555768e557 in do_handle_one_connection (connect=0x6110000410c8, put_in_cache=true) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#56 0x000055555768deb4 in handle_one_connection (arg=0x611000040f88) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#57 0x00005555582fa350 in pfs_spawn_thread (arg=0x618000005508) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#58 0x00007ffff7115609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#59 0x00007ffff6ce8133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
Attachments
Issue Links
- duplicates
-
MDEV-32707 Assertion Failed at /mariadb-11.3.0/sql/handler.cc:3765
- Confirmed