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

Assertion `info->last_key.keyinfo == key->keyinfo' failed in _ma_search_no_save with SELECT SQ and WHERE SQ

    Details

    • Sprint:
      5.5.47-1

      Description

      Note: it might be related to MDEV-7828.

      Stack trace from 5.5 commit 86f46a3da4a6d82cb510dc4c270d46cfd6a8965b

      storage/maria/ma_search.c:130: _ma_search_no_save: Assertion `info->last_key.keyinfo == key->keyinfo' failed.
      150327 16:18:33 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f338564f311 in *__GI___assert_fail (assertion=0xed2c60 "info->last_key.keyinfo == key->keyinfo", file=<optimized out>, line=130, function=0xed3210 "_ma_search_no_save") at assert.c:81
      #7  0x0000000000bd067f in _ma_search_no_save (info=0x7f33801c7060, key=0x7f3380bb41b0, nextflag=42, pos=16384, res_page_link=0x7f3380bb40f0, res_page_buff=0x7f3380bb40e8) at 5.5/storage/maria/ma_search.c:130
      #8  0x0000000000bd04ac in _ma_search (info=0x7f33801c7060, key=0x7f3380bb41b0, nextflag=42, pos=16384) at 5.5/storage/maria/ma_search.c:77
      #9  0x0000000000bcf122 in maria_rkey (info=0x7f33801c7060, buf=0x7f3380059978 "\377", inx=1, key_data=0x7f33802150a0 "", keypart_map=1, search_flag=HA_READ_AFTER_KEY) at 5.5/storage/maria/ma_rkey.c:103
      #10 0x0000000000b8ae02 in ha_maria::index_read_map (this=0x7f3380079078, buf=0x7f3380059978 "\377", key=0x7f33802150a0 "", keypart_map=1, find_flag=HA_READ_AFTER_KEY) at 5.5/storage/maria/ha_maria.cc:2300
      #11 0x00000000005cfa16 in handler::ha_index_read_map (this=0x7f3380079078, buf=0x7f3380059978 "\377", key=0x7f33802150a0 "", keypart_map=1, find_flag=HA_READ_AFTER_KEY) at 5.5/sql/sql_class.h:4212
      #12 0x00000000007f132b in handler::read_range_first (this=0x7f3380079078, start_key=0x7f3380079160, end_key=0x0, eq_range_arg=false, sorted=true) at 5.5/sql/handler.cc:4636
      #13 0x000000000076b734 in handler::multi_range_read_next (this=0x7f3380079078, range_info=0x7f3380bb4410) at 5.5/sql/multi_range_read.cc:296
      #14 0x000000000076b8fa in Mrr_simple_index_reader::get_next (this=0x7f33800795f8, range_info=0x7f3380bb4410) at 5.5/sql/multi_range_read.cc:328
      #15 0x000000000076e319 in DsMrr_impl::dsmrr_next (this=0x7f33800794b8, range_info=0x7f3380bb4410) at 5.5/sql/multi_range_read.cc:1409
      #16 0x0000000000b8e2d0 in ha_maria::multi_range_read_next (this=0x7f3380079078, range_info=0x7f3380bb4410) at 5.5/storage/maria/ha_maria.cc:3831
      #17 0x00000000008fe030 in QUICK_RANGE_SELECT::get_next (this=0x7f33801573e0) at 5.5/sql/opt_range.cc:11217
      #18 0x000000000090cf91 in rr_quick (info=0x7f33801d47a8) at 5.5/sql/records.cc:346
      #19 0x000000000068f7ea in join_init_read_record (tab=0x7f33801d46f8) at 5.5/sql/sql_select.cc:17797
      #20 0x000000000068d7bc in sub_select (join=0x7f33801cf078, join_tab=0x7f33801d46f8, end_of_records=false) at 5.5/sql/sql_select.cc:16910
      #21 0x000000000068d07c in do_select (join=0x7f33801cf078, fields=0x7f3381153b78, table=0x0, procedure=0x0) at 5.5/sql/sql_select.cc:16575
      #22 0x000000000066bce3 in JOIN::exec (this=0x7f33801cf078) at 5.5/sql/sql_select.cc:2873
      #23 0x000000000066c4ed in mysql_select (thd=0x7f3381150060, rref_pointer_array=0x7f3381153cd0, tables=0x7f33801cd4f8, wild_num=0, fields=..., conds=0x7f33801cdc80, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f33801cde90, unit=0x7f3381153380, select_lex=0x7f3381153a60) at 5.5/sql/sql_select.cc:3094
      #24 0x0000000000662fbd in handle_select (thd=0x7f3381150060, lex=0x7f33811532d0, result=0x7f33801cde90, setup_tables_done_option=0) at 5.5/sql/sql_select.cc:319
      #25 0x000000000063c1fc in execute_sqlcom_select (thd=0x7f3381150060, all_tables=0x7f33801cd4f8) at 5.5/sql/sql_parse.cc:4689
      #26 0x00000000006353de in mysql_execute_command (thd=0x7f3381150060) at 5.5/sql/sql_parse.cc:2234
      #27 0x000000000063ece2 in mysql_parse (thd=0x7f3381150060, rawbuf=0x7f3380287078 "SELECT \n( SELECT MAX(sq.pk) FROM t1 )\nFROM ( SELECT * FROM t2 ) AS sq\nWHERE sq.f > 253", length=86, parser_state=0x7f3380bb5620) at 5.5/sql/sql_parse.cc:5909
      #28 0x0000000000632925 in dispatch_command (command=COM_QUERY, thd=0x7f3381150060, packet=0x7f3381209061 "", packet_length=86) at 5.5/sql/sql_parse.cc:1079
      #29 0x0000000000631ab1 in do_command (thd=0x7f3381150060) at 5.5/sql/sql_parse.cc:793
      #30 0x0000000000734122 in do_handle_one_connection (thd_arg=0x7f3381150060) at 5.5/sql/sql_connect.cc:1266
      #31 0x0000000000733be1 in handle_one_connection (arg=0x7f3381150060) at 5.5/sql/sql_connect.cc:1181
      #32 0x0000000000b6c629 in pfs_spawn_thread (arg=0x7f3381171fc0) at 5.5/storage/perfschema/pfs.cc:1015
      #33 0x00007f338744ab50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #34 0x00007f338570070d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Test case

      CREATE TABLE t1 (i INT) ENGINE=Aria;
      INSERT INTO t1 VALUES (1),(2);
       
      CREATE TABLE t2 (pk INT PRIMARY KEY, f INT, KEY(f)) ENGINE=Aria;
      INSERT INTO t2 VALUES (1,8),(2,9);
       
      SELECT 
      ( SELECT MAX(sq.pk) FROM t1 )
      FROM ( SELECT * FROM t2 ) AS sq
      WHERE sq.f > 253;

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: