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

DELETE partition selection doesn't work for history partitions

    XMLWordPrintable

    Details

      Description

      Assertion `bitmap_is_set(&(m_part_info->read_partitions), part_id)' failed in ha_rows ha_partition::part_records(partition_element*)

      CREATE TABLE t (f CHAR) ENGINE InnoDB WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 1 (PARTITION p history,PARTITION p2 history,PARTITION pn current);
      DELETE FROM t PARTITION (p2);
      

      Leads to:

      10.8.0 1e8bcbd0a0bfa07052e9458830672ea215c8664a (Optimized)

      Core was generated by `/test/MD091221-mariadb-10.8.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055edf105e228 in ha_innobase::update_thd (this=0x15072801c6b0, 
          this=0x15072801c6b0, thd=0x150728000c58)
          at /test/10.8_opt/storage/innobase/handler/ha_innodb.cc:3083
      3083		if (m_prebuilt->trx != trx) {
      [Current thread is 1 (Thread 0x150765580700 (LWP 3492452))]
      (gdb) bt
      #0  0x000055edf105e228 in ha_innobase::update_thd (this=0x15072801c6b0, this=0x15072801c6b0, thd=0x150728000c58) at /test/10.8_opt/storage/innobase/handler/ha_innodb.cc:3083
      #1  ha_innobase::info_low (this=0x15072801c6b0, flag=274, is_analyze=<optimized out>) at /test/10.8_opt/storage/innobase/handler/ha_innodb.cc:14586
      #2  0x000055edf0c24ba0 in ha_partition::part_records (this=0x15072801be70, this=0x15072801be70, part_elem=<optimized out>) at /test/10.8_opt/sql/ha_partition.h:1623
      #3  partition_info::vers_set_hist_part (this=0x15072801e6b0, thd=thd@entry=0x150728000c58) at /test/10.8_opt/sql/partition_info.cc:831
      #4  0x000055edf0f98a13 in ha_partition::external_lock (this=0x15072801be70, thd=0x150728000c58, lock_type=1) at /test/10.8_opt/sql/ha_partition.cc:4110
      #5  0x000055edf0d6cd54 in handler::ha_external_lock (this=0x15072801be70, thd=thd@entry=0x150728000c58, lock_type=lock_type@entry=1) at /test/10.8_opt/sql/handler.cc:7042
      #6  0x000055edf0e86a40 in lock_external (count=<optimized out>, tables=0x150728011290, thd=0x150728000c58) at /test/10.8_opt/sql/lock.cc:393
      #7  mysql_lock_tables (thd=0x150728000c58, sql_lock=0x150728011270, flags=<optimized out>) at /test/10.8_opt/sql/lock.cc:338
      #8  0x000055edf0e87777 in mysql_lock_tables (thd=thd@entry=0x150728000c58, tables=0x150728011268, count=count@entry=1, flags=flags@entry=0) at /test/10.8_opt/sql/lock.cc:301
      #9  0x000055edf0aaac93 in lock_tables (thd=thd@entry=0x150728000c58, tables=0x1507280109e0, count=<optimized out>, flags=flags@entry=0) at /test/10.8_opt/sql/sql_base.cc:5559
      #10 0x000055edf0aac5fa in open_and_lock_tables (thd=thd@entry=0x150728000c58, options=<optimized out>, tables=<optimized out>, tables@entry=0x1507280109e0, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x15076557e670) at /test/10.8_opt/sql/sql_base.cc:5271
      #11 0x000055edf0acf42a in open_and_lock_tables (flags=0, derived=true, tables=0x1507280109e0, thd=0x150728000c58) at /test/10.8_opt/sql/sql_base.h:509
      #12 mysql_delete (thd=thd@entry=0x150728000c58, table_list=0x1507280109e0, conds=<optimized out>, order_list=order_list@entry=0x150728005980, limit=18446744073709551615, options=0, result=0x0) at /test/10.8_opt/sql/sql_delete.cc:341
      #13 0x000055edf0b1f62f in mysql_execute_command (thd=0x150728000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.8_opt/sql/sql_limit.h:83
      #14 0x000055edf0b0dae6 in mysql_parse (thd=0x150728000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.8_opt/sql/sql_parse.cc:8028
      #15 0x000055edf0b19e3d in dispatch_command (command=COM_QUERY, thd=0x150728000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.8_opt/sql/sql_class.h:1360
      #16 0x000055edf0b1c058 in do_command (thd=0x150728000c58, blocking=blocking@entry=true) at /test/10.8_opt/sql/sql_parse.cc:1402
      #17 0x000055edf0c3b537 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.8_opt/sql/sql_connect.cc:1418
      #18 0x000055edf0c3b87d in handle_one_connection (arg=arg@entry=0x55edf3285558) at /test/10.8_opt/sql/sql_connect.cc:1312
      #19 0x000055edf0fac453 in pfs_spawn_thread (arg=0x55edf32041f8) at /test/10.8_opt/storage/perfschema/pfs.cc:2201
      #20 0x000015077c936609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #21 0x000015077c525293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.8.0 1e8bcbd0a0bfa07052e9458830672ea215c8664a (Debug)

      mysqld: /test/10.8_dbg/sql/ha_partition.h:1622: ha_rows ha_partition::part_records(partition_element*): Assertion `bitmap_is_set(&(m_part_info->read_partitions), part_id)' failed.
      

      10.8.0 1e8bcbd0a0bfa07052e9458830672ea215c8664a (Debug)

      Core was generated by `/test/MD091221-mariadb-10.8.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      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 0x151be01f8700 (LWP 3484942))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000151bf4cb6859 in __GI_abort () at abort.c:79
      #2  0x0000151bf4cb6729 in __assert_fail_base (fmt=0x151bf4e4c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55cc284fd280 "bitmap_is_set(&(m_part_info->read_partitions), part_id)", file=0x55cc284fd220 "/test/10.8_dbg/sql/ha_partition.h", line=1622, function=<optimized out>) at assert.c:92
      #3  0x0000151bf4cc7f36 in __GI___assert_fail (assertion=assertion@entry=0x55cc284fd280 "bitmap_is_set(&(m_part_info->read_partitions), part_id)", file=file@entry=0x55cc284fd220 "/test/10.8_dbg/sql/ha_partition.h", line=line@entry=1622, function=function@entry=0x55cc284fd248 "ha_rows ha_partition::part_records(partition_element*)") at assert.c:101
      #4  0x000055cc279529c3 in ha_partition::part_records (part_elem=<optimized out>, this=0x151b9c01d7b0) at /test/10.8_dbg/sql/ha_partition.h:1622
      #5  partition_info::vers_set_hist_part (this=0x151b9c01f9f0, thd=thd@entry=0x151b9c000db8) at /test/10.8_dbg/sql/partition_info.cc:831
      #6  0x000055cc27dd54c0 in ha_partition::external_lock (this=0x151b9c01d7b0, thd=0x151b9c000db8, lock_type=1) at /test/10.8_dbg/sql/ha_partition.cc:4110
      #7  0x000055cc27b09fee in handler::ha_external_lock (this=0x151b9c01d7b0, thd=thd@entry=0x151b9c000db8, lock_type=lock_type@entry=1) at /test/10.8_dbg/sql/handler.cc:7042
      #8  0x000055cc27c7bee1 in lock_external (count=1, tables=0x151b9c0147b0, thd=0x151b9c000db8) at /test/10.8_dbg/sql/lock.cc:393
      #9  mysql_lock_tables (thd=thd@entry=0x151b9c000db8, sql_lock=sql_lock@entry=0x151b9c014790, flags=flags@entry=0) at /test/10.8_dbg/sql/lock.cc:338
      #10 0x000055cc27c7d063 in mysql_lock_tables (thd=thd@entry=0x151b9c000db8, tables=tables@entry=0x151b9c014788, count=count@entry=1, flags=flags@entry=0) at /test/10.8_dbg/sql/lock.cc:301
      #11 0x000055cc27763f8a in lock_tables (thd=thd@entry=0x151b9c000db8, tables=0x151b9c013f00, count=<optimized out>, flags=flags@entry=0) at /test/10.8_dbg/sql/sql_base.cc:5559
      #12 0x000055cc277661ad in open_and_lock_tables (thd=thd@entry=0x151b9c000db8, options=<optimized out>, tables=<optimized out>, tables@entry=0x151b9c013f00, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x151be01f65a0) at /test/10.8_dbg/sql/sql_base.cc:5271
      #13 0x000055cc2779a73e in open_and_lock_tables (flags=0, derived=true, tables=0x151b9c013f00, thd=0x151b9c000db8) at /test/10.8_dbg/sql/sql_base.h:509
      #14 mysql_delete (thd=thd@entry=0x151b9c000db8, table_list=0x151b9c013f00, conds=<optimized out>, order_list=order_list@entry=0x151b9c005ca0, limit=18446744073709551615, options=0, result=0x0) at /test/10.8_dbg/sql/sql_delete.cc:341
      #15 0x000055cc277fed6d in mysql_execute_command (thd=thd@entry=0x151b9c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_limit.h:83
      #16 0x000055cc277e8c64 in mysql_parse (thd=thd@entry=0x151b9c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x151be01f7400) at /test/10.8_dbg/sql/sql_parse.cc:8028
      #17 0x000055cc277f78e9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x151b9c000db8, packet=packet@entry=0x151b9c00b879 "DELETE FROM t PARTITION (p2)", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1360
      #18 0x000055cc277fad2b in do_command (thd=0x151b9c000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
      #19 0x000055cc279741c0 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55cc2b4359e8, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
      #20 0x000055cc279747c5 in handle_one_connection (arg=arg@entry=0x55cc2b4359e8) at /test/10.8_dbg/sql/sql_connect.cc:1312
      #21 0x000055cc27df6de6 in pfs_spawn_thread (arg=0x55cc2b349678) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
      #22 0x0000151bf51c4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #23 0x0000151bf4db3293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.32 (dbg), 10.3.32 (opt), 10.4.22 (dbg), 10.4.22 (opt), 10.5.13 (dbg), 10.5.13 (opt), 10.6.5 (dbg), 10.6.5 (opt), 10.7.1 (dbg), 10.7.1 (opt), 10.8.0 (dbg), 10.8.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.2.41 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              midenok Aleksey Midenkov
              Reporter:
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.