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

Assertion `0' failed in Field_varstring_compressed::key_cmp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.5
    • Fix Version/s: 10.5
    • Component/s: Data types, Server
    • Labels:
      None

      Description

      CREATE TABLE t1 (a VARCHAR(8) COMPRESSED) CHARACTER SET utf8mb4;
      CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
      INSERT INTO t1 VALUES ('foo'),('bar'),('foo');
       
      SELECT * FROM v1 WHERE a IN (SELECT a FROM t1);
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1;
      

      10.5 700ae20d

      mariadbd: /data/src/10.5/sql/field.h:4266: virtual int Field_varstring_compressed::key_cmp(const uchar*, uint) const: Assertion `0' failed.
      210128 19:28:08 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f0f8f871f36 in __GI___assert_fail (assertion=0x55c83aa37f07 "0", file=0x55c83aa37da4 "/data/src/10.5/sql/field.h", line=4266, function=0x55c83aa38600 "virtual int Field_varstring_compressed::key_cmp(const uchar*, uint) const") at assert.c:101
      #8  0x000055c839df374b in Field_varstring_compressed::key_cmp (this=0x7f0f7805c7e0, str=0x7f0f78060751 "\004", length=33) at /data/src/10.5/sql/field.h:4266
      #9  0x000055c839f3b06b in key_cmp_if_same (table=0x7f0f7805baf0, key=0x7f0f78060751 "\004", idx=0, key_length=36) at /data/src/10.5/sql/key.cc:315
      #10 0x000055c839e16c34 in handler::index_next_same (this=0x7f0f7805cc50, buf=0x7f0f7805c8d0 "\375\004", key=0x7f0f78060750 "", keylen=36) at /data/src/10.5/sql/handler.cc:5248
      #11 0x000055c839e11d7f in handler::ha_index_next_same (this=0x7f0f7805cc50, buf=0x7f0f7805c8d0 "\375\004", key=0x7f0f78060750 "", keylen=36) at /data/src/10.5/sql/handler.cc:3257
      #12 0x000055c839b23705 in join_read_next_same (info=0x7f0f7805fce0) at /data/src/10.5/sql/sql_select.cc:21518
      #13 0x000055c8399e3969 in READ_RECORD::read_record (this=0x7f0f7805fce0) at /data/src/10.5/sql/records.h:80
      #14 0x000055c839b2192a in sub_select (join=0x7f0f78056a30, join_tab=0x7f0f7805fc18, end_of_records=false) at /data/src/10.5/sql/sql_select.cc:20707
      #15 0x000055c839b21fb7 in evaluate_join_record (join=0x7f0f78056a30, join_tab=0x7f0f7805f870, error=0) at /data/src/10.5/sql/sql_select.cc:20911
      #16 0x000055c839b2186e in sub_select (join=0x7f0f78056a30, join_tab=0x7f0f7805f870, end_of_records=false) at /data/src/10.5/sql/sql_select.cc:20688
      #17 0x000055c839b20d04 in do_select (join=0x7f0f78056a30, procedure=0x0) at /data/src/10.5/sql/sql_select.cc:20222
      #18 0x000055c839af46a0 in JOIN::exec_inner (this=0x7f0f78056a30) at /data/src/10.5/sql/sql_select.cc:4466
      #19 0x000055c839af37c1 in JOIN::exec (this=0x7f0f78056a30) at /data/src/10.5/sql/sql_select.cc:4246
      #20 0x000055c839af4ff5 in mysql_select (thd=0x7f0f78000db8, tables=0x7f0f780145d8, fields=..., conds=0x7f0f780162f8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f0f78019df0, unit=0x7f0f78004f58, select_lex=0x7f0f78013fe8) at /data/src/10.5/sql/sql_select.cc:4719
      #21 0x000055c839ae4a73 in handle_select (thd=0x7f0f78000db8, lex=0x7f0f78004e90, result=0x7f0f78019df0, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:417
      #22 0x000055c839aa7449 in execute_sqlcom_select (thd=0x7f0f78000db8, all_tables=0x7f0f780145d8) at /data/src/10.5/sql/sql_parse.cc:6281
      #23 0x000055c839a9e4d5 in mysql_execute_command (thd=0x7f0f78000db8) at /data/src/10.5/sql/sql_parse.cc:3977
      #24 0x000055c839aac2f0 in mysql_parse (thd=0x7f0f78000db8, rawbuf=0x7f0f78013f30 "SELECT * FROM v1 WHERE a IN (SELECT a FROM t1)", length=46, parser_state=0x7f0f8a22c510, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:8062
      #25 0x000055c839a98277 in dispatch_command (command=COM_QUERY, thd=0x7f0f78000db8, packet=0x7f0f780090a9 "", packet_length=46, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1889
      #26 0x000055c839a96a6b in do_command (thd=0x7f0f78000db8) at /data/src/10.5/sql/sql_parse.cc:1370
      #27 0x000055c839c448d1 in do_handle_one_connection (connect=0x55c83dd4a848, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1410
      #28 0x000055c839c44634 in handle_one_connection (arg=0x55c83ddb7208) at /data/src/10.5/sql/sql_connect.cc:1312
      #29 0x000055c83a1a35cb in pfs_spawn_thread (arg=0x55c83dd4a488) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #30 0x00007f0f8fd89609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #31 0x00007f0f8f95d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.5+. Not reproducible on 10.4.
      No obvious immediate problem on a non-debug build.
      The failure started happening in 10.5 after this commit:

      commit eb483c5181ab430877c135c16224284cfc517b3d (HEAD)
      Author: Monty
      Date:   Fri Feb 28 12:59:30 2020 +0200
       
          Updated optimizer costs in multi_range_read_info_const() and sql_select.cc
      

      Reproducible with InnoDB and MyISAM. Not reproducible with Aria.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:

                Git Integration