Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32708

Assertion Failed at /mariadb-11.3.0/sql/filesort.cc:1194

    XMLWordPrintable

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)
    • N/A
    • Server
    • None
    • Ubuntu 20.04

    Description

      Run these queries in debug build:

      CREATE TABLE x ( x CHAR ( 1 ) PRIMARY KEY ) ;
      INSERT INTO x ( x ) VALUES ( 1 ) ;
      UPDATE x SET x = 1 , x = 'x' , x = x + 1 , x = 'x' WHERE CASE x = ( SELECT x FROM x WHERE x = ( SELECT x FROM x WHERE x = x GROUP BY ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT x AS x FROM x WHERE 1 = x GROUP BY x HAVING FALSE >= 1 UNION SELECT x FROM x ) SELECT x AS x FROM x WHERE 1 = x ) HAVING x LIKE 'x' WINDOW x AS ( PARTITION BY x ORDER BY x = ( WITH x AS ( SELECT * FROM x WINDOW x AS ( PARTITION BY x IN ( SELECT * FROM x ) ORDER BY x DESC ) ORDER BY ( SELECT x GROUP BY x , x ORDER BY x ASC , ( SELECT ( SELECT x ORDER BY ( x = 1 AND x = 1 ) DESC LIMIT 1 OFFSET 1 ) UNION SELECT x FROM x ) IS NULL LIMIT 1 OFFSET 1 ) ASC ) SELECT * FROM x WHERE x = ( SELECT * FROM x WHERE x = 'x' ORDER BY x , x DESC , x ASC , 1 , x DESC , - ( SELECT x = 1.000000 FROM x WHERE x = x GROUP BY - 'x' >= x HAVING x < 'x' ORDER BY x , x DESC , x ASC ) ) ) ASC ) ORDER BY x , x DESC , x ASC ) ORDER BY ( x = 1 AND ( x = x OR x = x ) ) , x DESC , x ASC , x ASC ) WHEN 1 THEN 1 ELSE 1 END ;

      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 0x0000555557b00947 in Type_handler_string_result::make_sort_key_part (this=0x55555b7b7000 <type_handler_string>, to=0x629000172288 '\276' <repeats 200 times>..., item=0x631000056a20, sort_field=0x631000069f60, tmp_buffer=0x7fffd1929318) at /home/wx/mariadb-11.3.0/sql/filesort.cc:1194
      #5 0x0000555557b0cd2d in make_sortkey (param=0x7fffd19292a0, to=0x629000172288 '\276' <repeats 200 times>...) at /home/wx/mariadb-11.3.0/sql/filesort.cc:2954
      #6 0x0000555557b02449 in make_sortkey (param=0x7fffd19292a0, to=0x629000172288 '\276' <repeats 200 times>..., ref_pos=0x61a000480408 "1", '\276' <repeats 199 times>..., using_packed_sortkeys=false) at /home/wx/mariadb-11.3.0/sql/filesort.cc:1414
      #7 0x0000555557aff864 in find_all_keys (thd=0x62c0001e0288, param=0x7fffd19292a0, select=0x62f000035b58, fs_info=0x615000124b00, buffpek_pointers=0x7fffd19295a0, tempfile=0x7fffd19293f0, pq=0x0, found_rows=0x615000124cf0) at /home/wx/mariadb-11.3.0/sql/filesort.cc:1030
      #8 0x0000555557afab66 in filesort (thd=0x62c0001e0288, table=0x619000085d08, filesort=0x631000056d90, tracker=0x631000057538, join=0x62f000007f80, first_table_bit=1) at /home/wx/mariadb-11.3.0/sql/filesort.cc:408
      #9 0x00005555573791c3 in create_sort_index (thd=0x62c0001e0288, join=0x62f000007f80, tab=0x62f000034ba8, fsort=0x631000056d90) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:26843
      #10 0x00005555573677dd in st_join_table::sort_table (this=0x62f000034ba8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24485
      #11 0x0000555557366bdc in join_init_read_record (tab=0x62f000034ba8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24405
      #12 0x0000555557360006 in sub_select (join=0x62f000007f80, join_tab=0x62f000034ba8, end_of_records=false) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23441
      #13 0x000055555735dadd in do_select (join=0x62f000007f80, procedure=0x0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
      #14 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f000007f80) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
      #15 0x00005555572d93a0 in JOIN::exec (this=0x62f000007f80) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
      #16 0x00005555572ddbab in mysql_select (thd=0x62c0001e0288, tables=0x6290001652c8, fields=..., conds=0x0, og_num=1, order=0x62900016f4f8, group=0x0, having=0x0, proc_param=0x0, select_options=2201188305408, result=0x62f000007e88, unit=0x6290001686e8, select_lex=0x629000164c70) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5249
      #17 0x00005555570d9bea in mysql_derived_fill (thd=0x62c0001e0288, lex=0x62c0001e45f8, derived=0x62900016fd00) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:1266
      #18 0x00005555570d27b6 in mysql_handle_single_derived (lex=0x62c0001e45f8, derived=0x62900016fd00, phases=96) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
      #19 0x000055555732a50c in st_join_table::preread_init (this=0x631000058c80) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:16029
      #20 0x000055555735f8c8 in sub_select (join=0x62f0000158f8, join_tab=0x631000058c80, end_of_records=false) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23392
      #21 0x000055555735dadd in do_select (join=0x62f0000158f8, procedure=0x0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
      #22 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f0000158f8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
      #23 0x00005555572d93a0 in JOIN::exec (this=0x62f0000158f8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
      #24 0x0000555557dce72f in subselect_single_select_engine::exec (this=0x62d000073678) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4159
      #25 0x0000555557da9c85 in Item_subselect::exec (this=0x62d0000734d8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
      #26 0x0000555557db0117 in Item_singlerow_subselect::val_str (this=0x62d0000734d8, str=0x62d0000738c8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1484
      #27 0x0000555557be9c31 in Arg_comparator::compare_string (this=0x62d000073778) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:773
      #28 0x0000555557c2e1d4 in Arg_comparator::compare (this=0x62d000073778) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.h:104
      #29 0x0000555557bf5bdb in Item_func_eq::val_int (this=0x62d0000736c0) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:1780
      #30 0x0000555557c706e4 in Item_int_func::val_str (this=0x62d0000736c0, str=0x631000066b78) at /home/wx/mariadb-11.3.0/sql/item_func.cc:760
      #31 0x0000555557b97a0b in Item_copy_string::copy (this=0x631000066b50) at /home/wx/mariadb-11.3.0/sql/item.cc:5092
      #32 0x000055555738496b in copy_fields (param=0x62f000013b38) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:28418
      #33 0x000055555736bca8 in end_send_group (join=0x62f0000138d8, join_tab=0x631000065db0, end_of_records=false) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:24949
      #34 0x000055555736194d in evaluate_join_record (join=0x62f0000138d8, join_tab=0x631000065938, error=0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23677
      #35 0x00005555573601c2 in sub_select (join=0x62f0000138d8, join_tab=0x631000065938, end_of_records=false) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:23444
      #36 0x000055555735dadd in do_select (join=0x62f0000138d8, procedure=0x0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:22961
      #37 0x00005555572dbfe9 in JOIN::exec_inner (this=0x62f0000138d8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4941
      #38 0x00005555572d93a0 in JOIN::exec (this=0x62f0000138d8) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:4718
      #39 0x0000555557dce72f in subselect_single_select_engine::exec (this=0x62d000074948) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:4159
      #40 0x0000555557da9c85 in Item_subselect::exec (this=0x62d0000747a8) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:812
      #41 0x0000555557db0117 in Item_singlerow_subselect::val_str (this=0x62d0000747a8, str=0x62d0000747d0) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:1484
      #42 0x0000555557ba4baa in Item::save_str_in_field (this=0x62d0000747a8, field=0x631000069c10, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/item.cc:6805
      #43 0x00005555578b21a0 in Type_handler_string_result::Item_save_in_field (this=0x55555b7b7000 <type_handler_string>, item=0x62d0000747a8, field=0x631000069c10, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/sql_type.cc:4320
      #44 0x0000555557ba540b in Item::save_in_field (this=0x62d0000747a8, field=0x631000069c10, no_conversions=true) at /home/wx/mariadb-11.3.0/sql/item.cc:6853
      #45 0x00005555573b87aa in store_key_item::copy_inner (this=0x7fffd192cae0) at /home/wx/mariadb-11.3.0/sql/sql_select.h:2142
      #46 0x00005555573b7c69 in store_key::copy (this=0x7fffd192cae0, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.h:2035
      #47 0x0000555557315051 in create_ref_for_key (join=0x62f0000128c0, j=0x631000068e20, org_keyuse=0x631000068518, allow_full_scan=true, used_tables=4611686018427387905) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:13064
      #48 0x0000555557311de5 in JOIN::get_best_combination (this=0x62f0000128c0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:12728
      #49 0x00005555572c34e4 in JOIN::optimize_stage2 (this=0x62f0000128c0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2671
      #50 0x00005555572c2f34 in JOIN::optimize_inner (this=0x62f0000128c0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2650
      #51 0x00005555572bbba6 in JOIN::optimize (this=0x62f0000128c0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
      #52 0x0000555557143851 in st_select_lex::optimize_unflattened_subqueries (this=0x62c0001e4f10, const_only=true) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4916
      #53 0x00005555577b75f6 in JOIN::optimize_constant_subqueries (this=0x62f000011850) at /home/wx/mariadb-11.3.0/sql/opt_subselect.cc:5898
      #54 0x00005555572beb79 in JOIN::optimize_inner (this=0x62f000011850) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:2274
      #55 0x00005555572bbba6 in JOIN::optimize (this=0x62f000011850) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1944
      #56 0x00005555573a8253 in Sql_cmd_dml::execute_inner (this=0x6290000f6c80, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33401
      #57 0x0000555557569d49 in Sql_cmd_update::execute_inner (this=0x6290000f6c80, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_update.cc:3069
      #58 0x00005555573a7f0d in Sql_cmd_dml::execute (this=0x6290000f6c80, thd=0x62c0001e0288) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:33350
      #59 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
      #60 0x00005555571d95e2 in mysql_parse (thd=0x62c0001e0288, rawbuf=0x6290000f52a8 "UPDATE x SET x = 1 , x = 'x' , x = x + 1 , x = 'x' WHERE CASE x = ( SELECT x FROM x WHERE x = ( SELECT x FROM x WHERE x = x GROUP BY ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT x AS x FROM"..., length=987, parser_state=0x7fffd192e870) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
      #61 0x00005555571b1237 in dispatch_command (command=COM_QUERY, thd=0x62c0001e0288, packet=0x6290000fa289 " UPDATE x SET x = 1 , x = 'x' , x = x + 1 , x = 'x' WHERE CASE x = ( SELECT x FROM x WHERE x = ( SELECT x FROM x WHERE x = x GROUP BY ( WITH RECURSIVE x ( x ) AS ( SELECT 1 INTERSECT SELECT x AS x FRO"..., packet_length=991, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
      #62 0x00005555571adf7c in do_command (thd=0x62c0001e0288, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
      #63 0x000055555768e557 in do_handle_one_connection (connect=0x61100007d488, put_in_cache=true) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
      #64 0x000055555768deb4 in handle_one_connection (arg=0x61100007d348) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
      #65 0x00005555582fa350 in pfs_spawn_thread (arg=0x618000005508) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
      #66 0x00007ffff7115609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
      #67 0x00007ffff6ce8133 in clone () from /lib/x86_64-linux-gnu/libc.so.6

      Attachments

        Issue Links

          Activity

            People

              alice Alice Sherepa
              Xin Wen Xin Wen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.