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

Assertion `bit < map->n_bits' failed in bitmap_is_set

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4, 11.5(EOL)
    • 10.5, 10.6, 10.11, 11.4
    • Partitioning
    • None

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (id int, a int, KEY id (id), KEY (a)) partition BY list (id) (PARTITION p1 VALUES IN (1,2,3,4,5,6,7,8,9,10 ));
      INSERT INTO t1 VALUES (1,5),(2,3),(3,7),(4,2),(5,7),(6,4),(7,9),(8,7),(9,NULL),(10,NULL);
       
      SELECT  * FROM t1 WHERE id IN (255) OR a IN (25,1);
      

      Version: '10.4.31-MariaDB-debug-log'  
      mysqld: /10.4/include/my_bitmap.h:133: uint bitmap_is_set(const MY_BITMAP*, uint): Assertion `bit < (map)->n_bits' failed.
      230808 15:54:09 [ERROR] mysqld got signal 6 ;
       
       
      Server version: 10.4.31-MariaDB-debug-log source revision: 277968aa4cfa46a290af1c44e9d756381005939a
       
      stdlib/abort.c:81(__GI_abort)[0x7f6c4ba50535]
      intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f6c4ba5040f]
      /lib/x86_64-linux-gnu/libc.so.6(+0x301a2)[0x7f6c4ba5e1a2]
      include/my_bitmap.h:134(bitmap_is_set)[0x55750729481e]
      sql/ha_partition.cc:7687(ha_partition::handle_ordered_index_scan(unsigned char*, bool))[0x5575072d274c]
      sql/ha_partition.cc:6649(ha_partition::multi_range_read_next(void**))[0x5575072c871d]
      sql/opt_range.cc:12345(QUICK_RANGE_SELECT::get_next())[0x557506e4900d]
      sql/opt_range.cc:11894(read_keys_and_merge_scans(THD*, TABLE*, List<QUICK_RANGE_SELECT>, QUICK_RANGE_SELECT*, READ_RECORD*, bool, Bitmap<64u>*, Unique**))[0x557506e44a45]
      sql/opt_range.cc:11963(QUICK_INDEX_MERGE_SELECT::read_keys_and_merge())[0x557506e4533d]
      sql/opt_range.cc:1389(QUICK_INDEX_SORT_SELECT::reset())[0x557506dfe168]
      sql/sql_select.cc:21820(join_init_read_record(st_join_table*))[0x5575063fc8b9]
      sql/sql_select.cc:20886(sub_select(JOIN*, st_join_table*, bool))[0x5575063f5e75]
      sql/sql_select.cc:20412(do_select(JOIN*, Procedure*))[0x5575063f3ec1]
      sql/sql_select.cc:4605(JOIN::exec_inner())[0x557506382f84]
      sql/sql_select.cc:4388(JOIN::exec())[0x5575063805d0]
      sql/sql_select.cc:4828(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55750638462f]
      sql/sql_select.cc:442(handle_select(THD*, LEX*, select_result*, unsigned long))[0x557506355942]
      sql/sql_parse.cc:6473(execute_sqlcom_select(THD*, TABLE_LIST*))[0x5575062c4fbd]
      sql/sql_parse.cc:3976(mysql_execute_command(THD*))[0x5575062b2716]
      sql/sql_parse.cc:8010(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5575062ce12b]
      sql/sql_parse.cc:1860(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5575062a4ba9]
      sql/sql_parse.cc:1378(do_command(THD*))[0x5575062a16b5]
      sql/sql_connect.cc:1420(do_handle_one_connection(CONNECT*))[0x55750669c7f1]
      sql/sql_connect.cc:1325(handle_one_connection)[0x55750669c093]
      perfschema/pfs.cc:1871(pfs_spawn_thread)[0x5575073792f1]
      nptl/pthread_create.c:487(start_thread)[0x7f6c4bf1bfa3]
      x86_64/clone.S:97(clone)[0x7f6c4bb2706f]
       
      Query (0x62b000062290): SELECT  * FROM t1 WHERE id IN (255) OR a IN (25,1)
      

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar added a comment - - edited

            --source include/have_innodb.inc
            --source include/have_partition.inc
            CREATE TABLE t (c INT) ENGINE=InnoDB PARTITION BY LIST (c) (PARTITION p VALUES IN (NULL));
            ALTER TABLE t ADD KEY(c);
            DELETE FROM t WHERE c=0;
            

            Leads to:

            11.5.0 929c2e06aae47f2dabf51b843ac84911de95bc7f (Debug)

            mariadbd: /test/11.5_dbg/include/my_bitmap.h:106: uint bitmap_is_set(const MY_BITMAP*, uint): Assertion `bit < map->n_bits' failed.
            

            11.5.0 929c2e06aae47f2dabf51b843ac84911de95bc7f (Debug)

            Core was generated by `/test/MD020324-mariadb-11.5.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2955146)]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
            #3  0x000014d2c3a3c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
            #4  0x000014d2c3a2287c in __GI_abort () at ./stdlib/abort.c:79
            #5  0x000014d2c3a2279b in __assert_fail_base (fmt=0x14d2c3bb9f68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x556ef824f909 "bit < map->n_bits", file=file@entry=0x556ef7f48348 "/test/11.5_dbg/include/my_bitmap.h", line=line@entry=106, function=function@entry=0x556ef7f512c8 "uint bitmap_is_set(const MY_BITMAP*, uint)") at ./assert/assert.c:92
            #6  0x000014d2c3a33b86 in __assert_fail (assertion=0x556ef824f909 "bit < map->n_bits", file=0x556ef7f48348 "/test/11.5_dbg/include/my_bitmap.h", line=106, function=0x556ef7f512c8 "uint bitmap_is_set(const MY_BITMAP*, uint)")at ./assert/assert.c:101
            #7  0x0000556ef790584f in bitmap_is_set (bit=4294967295, map=0x14d27802ce98)at /test/11.5_dbg/include/my_bitmap.h:106
            #8  ha_partition::handle_ordered_index_scan (this=this@entry=0x14d27802b520, buf=0x14d27803edd8 "\377", reverse_order=reverse_order@entry=false)at /test/11.5_dbg/sql/ha_partition.cc:7914
            #9  0x0000556ef7906dcd in ha_partition::multi_range_read_next (this=0x14d27802b520, range_info=0x14d2c008c898)at /test/11.5_dbg/sql/ha_partition.cc:6882
            #10 0x0000556ef7230bb5 in QUICK_RANGE_SELECT::get_next (this=0x14d27807dd50)at /test/11.5_dbg/sql/opt_range.cc:13194
            #11 0x0000556ef7265680 in rr_quick (info=0x14d2c008ca50)at /test/11.5_dbg/sql/records.cc:402
            #12 0x0000556ef72fb388 in READ_RECORD::read_record (this=0x14d2c008ca50)at /test/11.5_dbg/sql/records.h:81
            #13 Sql_cmd_delete::delete_from_single_table (this=this@entry=0x14d27801a118, thd=thd@entry=0x14d278000d58) at /test/11.5_dbg/sql/sql_delete.cc:799
            #14 0x0000556ef72fc325 in Sql_cmd_delete::execute_inner (this=0x14d27801a118, thd=0x14d278000d58) at /test/11.5_dbg/sql/sql_delete.cc:1810
            #15 0x0000556ef7393a27 in Sql_cmd_dml::execute (this=0x14d27801a118, thd=0x14d278000d58) at /test/11.5_dbg/sql/sql_select.cc:33586
            #16 0x0000556ef734fda6 in mysql_execute_command (thd=thd@entry=0x14d278000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.5_dbg/sql/sql_parse.cc:4392
            #17 0x0000556ef73550d1 in mysql_parse (thd=thd@entry=0x14d278000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d2c008d260)at /test/11.5_dbg/sql/sql_parse.cc:7815
            #18 0x0000556ef7357494 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d278000d58, packet=packet@entry=0x14d27800b1d9 "DELETE FROM t WHERE c=0", packet_length=packet_length@entry=23, blocking=blocking@entry=true)at /test/11.5_dbg/sql/sql_class.h:254
            #19 0x0000556ef73597e6 in do_command (thd=0x14d278000d58, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_parse.cc:1406
            #20 0x0000556ef74c2357 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556efa3a9168, put_in_cache=put_in_cache@entry=true)at /test/11.5_dbg/sql/sql_connect.cc:1437
            #21 0x0000556ef74c264c in handle_one_connection (arg=arg@entry=0x556efa3a9168)at /test/11.5_dbg/sql/sql_connect.cc:1339
            #22 0x0000556ef7910bcc in pfs_spawn_thread (arg=0x556efa2f83b8)at /test/11.5_dbg/storage/perfschema/pfs.cc:2201
            #23 0x000014d2c3a8f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
            #24 0x000014d2c3b1dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            

            Roel Roel Van de Paar added a comment - - edited --source include/have_innodb.inc --source include/have_partition.inc CREATE TABLE t (c INT ) ENGINE=InnoDB PARTITION BY LIST (c) (PARTITION p VALUES IN ( NULL )); ALTER TABLE t ADD KEY (c); DELETE FROM t WHERE c=0; Leads to: 11.5.0 929c2e06aae47f2dabf51b843ac84911de95bc7f (Debug) mariadbd: /test/11.5_dbg/include/my_bitmap.h:106: uint bitmap_is_set(const MY_BITMAP*, uint): Assertion `bit < map->n_bits' failed. 11.5.0 929c2e06aae47f2dabf51b843ac84911de95bc7f (Debug) Core was generated by `/test/MD020324-mariadb-11.5.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 [Current thread is 1 (LWP 2955146)] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89 #3 0x000014d2c3a3c406 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26 #4 0x000014d2c3a2287c in __GI_abort () at ./stdlib/abort.c:79 #5 0x000014d2c3a2279b in __assert_fail_base (fmt=0x14d2c3bb9f68 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x556ef824f909 "bit < map->n_bits", file=file@entry=0x556ef7f48348 "/test/11.5_dbg/include/my_bitmap.h", line=line@entry=106, function=function@entry=0x556ef7f512c8 "uint bitmap_is_set(const MY_BITMAP*, uint)") at ./assert/assert.c:92 #6 0x000014d2c3a33b86 in __assert_fail (assertion=0x556ef824f909 "bit < map->n_bits", file=0x556ef7f48348 "/test/11.5_dbg/include/my_bitmap.h", line=106, function=0x556ef7f512c8 "uint bitmap_is_set(const MY_BITMAP*, uint)")at ./assert/assert.c:101 #7 0x0000556ef790584f in bitmap_is_set (bit=4294967295, map=0x14d27802ce98)at /test/11.5_dbg/include/my_bitmap.h:106 #8 ha_partition::handle_ordered_index_scan (this=this@entry=0x14d27802b520, buf=0x14d27803edd8 "\377", reverse_order=reverse_order@entry=false)at /test/11.5_dbg/sql/ha_partition.cc:7914 #9 0x0000556ef7906dcd in ha_partition::multi_range_read_next (this=0x14d27802b520, range_info=0x14d2c008c898)at /test/11.5_dbg/sql/ha_partition.cc:6882 #10 0x0000556ef7230bb5 in QUICK_RANGE_SELECT::get_next (this=0x14d27807dd50)at /test/11.5_dbg/sql/opt_range.cc:13194 #11 0x0000556ef7265680 in rr_quick (info=0x14d2c008ca50)at /test/11.5_dbg/sql/records.cc:402 #12 0x0000556ef72fb388 in READ_RECORD::read_record (this=0x14d2c008ca50)at /test/11.5_dbg/sql/records.h:81 #13 Sql_cmd_delete::delete_from_single_table (this=this@entry=0x14d27801a118, thd=thd@entry=0x14d278000d58) at /test/11.5_dbg/sql/sql_delete.cc:799 #14 0x0000556ef72fc325 in Sql_cmd_delete::execute_inner (this=0x14d27801a118, thd=0x14d278000d58) at /test/11.5_dbg/sql/sql_delete.cc:1810 #15 0x0000556ef7393a27 in Sql_cmd_dml::execute (this=0x14d27801a118, thd=0x14d278000d58) at /test/11.5_dbg/sql/sql_select.cc:33586 #16 0x0000556ef734fda6 in mysql_execute_command (thd=thd@entry=0x14d278000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.5_dbg/sql/sql_parse.cc:4392 #17 0x0000556ef73550d1 in mysql_parse (thd=thd@entry=0x14d278000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d2c008d260)at /test/11.5_dbg/sql/sql_parse.cc:7815 #18 0x0000556ef7357494 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d278000d58, packet=packet@entry=0x14d27800b1d9 "DELETE FROM t WHERE c=0", packet_length=packet_length@entry=23, blocking=blocking@entry=true)at /test/11.5_dbg/sql/sql_class.h:254 #19 0x0000556ef73597e6 in do_command (thd=0x14d278000d58, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_parse.cc:1406 #20 0x0000556ef74c2357 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x556efa3a9168, put_in_cache=put_in_cache@entry=true)at /test/11.5_dbg/sql/sql_connect.cc:1437 #21 0x0000556ef74c264c in handle_one_connection (arg=arg@entry=0x556efa3a9168)at /test/11.5_dbg/sql/sql_connect.cc:1339 #22 0x0000556ef7910bcc in pfs_spawn_thread (arg=0x556efa2f83b8)at /test/11.5_dbg/storage/perfschema/pfs.cc:2201 #23 0x000014d2c3a8f18a in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444 #24 0x000014d2c3b1dbd0 in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

            People

              serg Sergei Golubchik
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.