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

Assertion `(key_part->key_part_flag & 4) == 0' failed in ulong key_hashnr(KEY*, uint, const uchar*)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5, 10.6, 10.11
    • 10.5, 10.6, 10.11
    • None

    Description

      SET sql_mode='';
      SET SESSION in_predicate_conversion_threshold=2;
      SET SESSION enforce_storage_engine=MEMORY;
      SET join_cache_level=3;
      CREATE TABLE t (c INT,c2 CHAR(20)) ENGINE=MYISAM;
      INSERT INTO t VALUES (DEFAULT,DEFAULT);
      INSERT INTO t (c) VALUES (1);
      SELECT * FROM t WHERE c2 IN ('','');
      

      Leads to:

      10.11.9 27a3366663d91d4181cafc7d4a8569d06d6a759e (Debug)

      mariadbd: /test/10.11_dbg/sql/key.cc:765: ulong key_hashnr(KEY*, uint, const uchar*): Assertion `(key_part->key_part_flag & 4) == 0' failed.
      

      10.11.9 27a3366663d91d4181cafc7d4a8569d06d6a759e (Debug)

      Core was generated by `/test/MD270624-mariadb-10.11.9-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14a2a80d6700 (LWP 1162556))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014a2a9f38859 in __GI_abort () at abort.c:79
      #2  0x000014a2a9f38729 in __assert_fail_base (fmt=0x14a2aa0ce588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c850a4bb00 "(key_part->key_part_flag & 4) == 0", file=0x55c850a4bb61 "/test/10.11_dbg/sql/key.cc", line=765, function=<optimized out>) at assert.c:92
      #3  0x000014a2a9f49fd6 in __GI___assert_fail (assertion=assertion@entry=0x55c850a4bb00 "(key_part->key_part_flag & 4) == 0", file=file@entry=0x55c850a4bb61 "/test/10.11_dbg/sql/key.cc", line=line@entry=765, function=function@entry=0x55c850a4bad0 "ulong key_hashnr(KEY*, uint, const uchar*)") at assert.c:101
      #4  0x000055c84ffde637 in key_hashnr (key_info=<optimized out>, used_key_parts=<optimized out>, key=0x14a2680a8343 "") at /test/10.11_dbg/sql/key.cc:765
      #5  0x000055c84fd434cd in JOIN_CACHE_HASHED::get_hash_idx_complex (this=0x14a2680a8910, key=<optimized out>, key_len=<optimized out>) at /test/10.11_dbg/sql/sql_join_cache.cc:3323
      #6  0x000055c84fd41b39 in JOIN_CACHE_HASHED::key_search (this=this@entry=0x14a2680a8910, key=key@entry=0x14a2680a8338 "", key_len=key_len@entry=11, key_ref_ptr=key_ref_ptr@entry=0x14a2a80d4268) at /test/10.11_dbg/sql/sql_join_cache.cc:3244
      #7  0x000055c84fd41cf9 in JOIN_CACHE_HASHED::put_record (this=0x14a2680a8910) at /test/10.11_dbg/sql/sql_join_cache.cc:3083
      #8  0x000055c84fbe088d in sub_select_cache (join=0x14a268014f58, join_tab=0x14a2680adad0, end_of_records=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:22147
      #9  0x000055c84fbccab7 in evaluate_join_record (join=join@entry=0x14a268014f58, join_tab=join_tab@entry=0x14a2680ad708, error=error@entry=0) at /test/10.11_dbg/sql/sql_select.cc:22609
      #10 0x000055c84fbe03a7 in sub_select (join=0x14a268014f58, join_tab=0x14a2680ad708, end_of_records=<optimized out>) at /test/10.11_dbg/sql/sql_select.cc:22379
      #11 0x000055c84fc182ab in do_select (procedure=<optimized out>, join=0x14a268014f58) at /test/10.11_dbg/sql/sql_select.cc:21902
      #12 JOIN::exec_inner (this=this@entry=0x14a268014f58) at /test/10.11_dbg/sql/sql_select.cc:4938
      #13 0x000055c84fc187c8 in JOIN::exec (this=this@entry=0x14a268014f58) at /test/10.11_dbg/sql/sql_select.cc:4716
      #14 0x000055c84fc1674e in mysql_select (thd=thd@entry=0x14a268000d48, tables=0x14a268013b48, fields=@0x14a2680137d0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14a268013af8, last = 0x14a268015980, elements = 2}, <No data fields>}, conds=0x14a2680144c8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x14a268014f30, unit=0x14a2680051e8, select_lex=0x14a268013518) at /test/10.11_dbg/sql/sql_select.cc:5196
      #15 0x000055c84fc16f48 in handle_select (thd=thd@entry=0x14a268000d48, lex=lex@entry=0x14a268005110, result=result@entry=0x14a268014f30, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.11_dbg/sql/sql_select.cc:586
      #16 0x000055c84fb7c6d5 in execute_sqlcom_select (thd=thd@entry=0x14a268000d48, all_tables=0x14a268013b48) at /test/10.11_dbg/sql/sql_parse.cc:6385
      #17 0x000055c84fb8933b in mysql_execute_command (thd=thd@entry=0x14a268000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:3988
      #18 0x000055c84fb7645a in mysql_parse (thd=thd@entry=0x14a268000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a2a80d52f0) at /test/10.11_dbg/sql/sql_parse.cc:8143
      #19 0x000055c84fb84536 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a268000d48, packet=packet@entry=0x14a26800b139 "", packet_length=packet_length@entry=35, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1398
      #20 0x000055c84fb86e9d in do_command (thd=0x14a268000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1408
      #21 0x000055c84fcf921b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c85385c1b8, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1417
      #22 0x000055c84fcf97d0 in handle_one_connection (arg=arg@entry=0x55c85385c1b8) at /test/10.11_dbg/sql/sql_connect.cc:1319
      #23 0x000055c850150a8c in pfs_spawn_thread (arg=0x55c8537b6738) at /test/10.11_dbg/storage/perfschema/pfs.cc:2201
      #24 0x000014a2aa449609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #25 0x000014a2aa035133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.26 (dbg), 10.6.19 (dbg), 10.11.9 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.26 (opt), 10.6.19 (opt), 10.11.9 (opt), 11.1.5 (dbg), 11.1.5 (opt), 11.1.6 (dbg), 11.1.6 (opt), 11.2.4 (dbg), 11.2.4 (opt), 11.4.2 (dbg), 11.4.2 (opt), 11.5.2 (dbg), 11.5.2 (opt)

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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