[MDEV-22667] Multi-delete on table with unique blob and partitions: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON, Error 126: Index is corrupted, Assertion `bitmap_is_set(&(m_part_info->read_partitions), m_last_part)' failed Created: 2020-05-22  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Partitioning, Server, Versioned Tables
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-20515 multi-update tries to position update... Closed
relates to MDEV-22714 Assertion `index->table->is_instant()... Closed
relates to MDEV-25532 Assertion `part_id == m_last_part' fa... Open
relates to MDEV-32212 DELETE with ORDER BY and semijoin opt... Closed

 Description   

Notes:

  • Possibly system versioning is not necessary, but I couldn't get rid of it.
  • While the test case does not use virtual columns explicitly, it is likely to be related to a number of virtual column bugs.
  • Without partitioning the InnoDB version of test case causes the assertion failure btr_validate_index(index, 0) for which we have plenty of reports already – MDEV-20661, MDEV-20618, etc.

With InnoDB

--source include/have_partition.inc
--source include/have_innodb.inc
 
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT  INTO t1 VALUES (1),(2),(3),(4),(5),(6);
 
CREATE TABLE t2 (f BLOB UNIQUE) ENGINE=InnoDB WITH SYSTEM VERSIONING PARTITION BY system_time INTERVAL 1 WEEK (PARTITION p1 HISTORY, PARTITION pn CURRENT);
INSERT INTO t2 VALUES (NULL),('');
 
DELETE t2.* FROM t1, t2;
 
# Cleanup
DROP TABLE t1, t2;

10.4 non-debug dc22acfd

2020-05-22 14:49:55 0x7f10b4659700  InnoDB: Assertion failure in file /data/src/10.4/storage/innobase/row/row0mysql.cc line 1855
InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON
 
#6  0x0000564559da6a2f in ut_dbg_assertion_failed (expr=expr@entry=0x56455a75bc08 "node->pcur->rel_pos == BTR_PCUR_ON", file=file@entry=0x56455a75b3e0 "/data/src/10.4/storage/innobase/row/row0mysql.cc", line=line@entry=1855) at /data/src/10.4/storage/innobase/ut/ut0dbg.cc:60
#7  0x000056455a2ad50f in row_update_for_mysql (prebuilt=0x7f105c0468c8) at /data/src/10.4/storage/innobase/row/row0mysql.cc:1855
#8  0x000056455a1fa17a in ha_innobase::delete_row (this=0x7f105c04d320, record=0x7f105c050220 "\374") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:8921
#9  0x000056455a07c2f7 in handler::ha_delete_row (this=0x7f105c04d320, buf=buf@entry=0x7f105c050220 "\374") at /data/src/10.4/sql/handler.cc:6814
#10 0x000056455a50dd35 in ha_partition::delete_row (this=0x7f105c0439d0, buf=0x7f105c050220 "\374") at /data/src/10.4/sql/ha_partition.cc:4558
#11 0x000056455a07c283 in handler::ha_delete_row (this=0x7f105c0439d0, buf=0x7f105c050220 "\374") at /data/src/10.4/sql/handler.cc:6814
#12 0x000056455a199d87 in TABLE::delete_row (this=0x7f105c042bd8) at /data/src/10.4/sql/sql_delete.cc:289
#13 multi_delete::send_data (this=0x7f105c011478, values=...) at /data/src/10.4/sql/sql_delete.cc:1346
#14 0x0000564559ec4c8f in end_send (join=0x7f105c011a28, join_tab=0x7f105c0148f8, end_of_records=<optimized out>) at /data/src/10.4/sql/sql_select.cc:21555
#15 0x0000564559ea7b9d in evaluate_join_record (join=join@entry=0x7f105c011a28, join_tab=join_tab@entry=0x7f105c014550, error=error@entry=0) at /data/src/10.4/sql/sql_select.cc:20586
#16 0x0000564559eb5fef in sub_select (join=0x7f105c011a28, join_tab=0x7f105c014550, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20405
#17 0x0000564559ea7b9d in evaluate_join_record (join=join@entry=0x7f105c011a28, join_tab=join_tab@entry=0x7f105c0141a8, error=error@entry=0) at /data/src/10.4/sql/sql_select.cc:20586
#18 0x0000564559eb5fef in sub_select (join=0x7f105c011a28, join_tab=0x7f105c0141a8, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20405
#19 0x0000564559ed636e in do_select (procedure=<optimized out>, join=0x7f105c011a28) at /data/src/10.4/sql/sql_select.cc:19904
#20 JOIN::exec_inner (this=this@entry=0x7f105c011a28) at /data/src/10.4/sql/sql_select.cc:4459
#21 0x0000564559ed6584 in JOIN::exec (this=this@entry=0x7f105c011a28) at /data/src/10.4/sql/sql_select.cc:4241
#22 0x0000564559ed49d0 in mysql_select (thd=thd@entry=0x7f105c0009a8, tables=0x7f105c010598, wild_num=wild_num@entry=0, fields=..., conds=conds@entry=0x0, og_num=og_num@entry=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489926016, result=0x7f105c011478, unit=0x7f105c004710, select_lex=0x7f105c004f08) at /data/src/10.4/sql/sql_select.cc:4673
#23 0x0000564559e80bba in mysql_execute_command (thd=thd@entry=0x7f105c0009a8) at /data/src/10.4/sql/sql_parse.cc:4784
#24 0x0000564559e85ac9 in mysql_parse (thd=thd@entry=0x7f105c0009a8, rawbuf=<optimized out>, length=23, parser_state=parser_state@entry=0x7f10b46585b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:7900
#25 0x0000564559e87cbf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f105c0009a8, packet=packet@entry=0x7f105c007a19 "DELETE t2.* FROM t1, t2", packet_length=packet_length@entry=23, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.4/sql/sql_parse.cc:1842
#26 0x0000564559e89431 in do_command (thd=0x7f105c0009a8) at /data/src/10.4/sql/sql_parse.cc:1360
#27 0x0000564559f58c04 in do_handle_one_connection (connect=connect@entry=0x56455d07c638) at /data/src/10.4/sql/sql_connect.cc:1412
#28 0x0000564559f58cb4 in handle_one_connection (arg=arg@entry=0x56455d07c638) at /data/src/10.4/sql/sql_connect.cc:1316
#29 0x000056455a4fb6a4 in pfs_spawn_thread (arg=0x56455d03d208) at /data/src/10.4/storage/perfschema/pfs.cc:1869
#30 0x00007f10bd23a4a4 in start_thread (arg=0x7f10b4659700) at pthread_create.c:456
#31 0x00007f10bb36ed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

10.4 debug dc22acfd

mysqld: /data/src/10.4/sql/ha_partition.cc:5190: virtual void ha_partition::position(const uchar*): Assertion `bitmap_is_set(&(m_part_info->read_partitions), m_last_part)' failed.
200522 14:52:37 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f3428f6ef12 in __GI___assert_fail (assertion=0x55ddf38abfb8 "bitmap_is_set(&(m_part_info->read_partitions), m_last_part)", file=0x55ddf38aaed0 "/data/src/10.4/sql/ha_partition.cc", line=5190, function=0x55ddf38af4c0 <ha_partition::position(unsigned char const*)::__PRETTY_FUNCTION__> "virtual void ha_partition::position(const uchar*)") at assert.c:101
#8  0x000055ddf33a2ea4 in ha_partition::position (this=0x7f33d006b348, record=0x7f33d0072d58 "\374") at /data/src/10.4/sql/ha_partition.cc:5190
#9  0x000055ddf2d1fc9c in multi_delete::send_data (this=0x7f33d0014850, values=...) at /data/src/10.4/sql/sql_delete.cc:1333
#10 0x000055ddf287f3b1 in end_send (join=0x7f33d0014e00, join_tab=0x7f33d0017cd0, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:21555
#11 0x000055ddf287ca43 in evaluate_join_record (join=0x7f33d0014e00, join_tab=0x7f33d0017928, error=0) at /data/src/10.4/sql/sql_select.cc:20586
#12 0x000055ddf287c4de in sub_select (join=0x7f33d0014e00, join_tab=0x7f33d0017928, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20405
#13 0x000055ddf287ca43 in evaluate_join_record (join=0x7f33d0014e00, join_tab=0x7f33d0017580, error=0) at /data/src/10.4/sql/sql_select.cc:20586
#14 0x000055ddf287c4de in sub_select (join=0x7f33d0014e00, join_tab=0x7f33d0017580, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20405
#15 0x000055ddf287b7b8 in do_select (join=0x7f33d0014e00, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:19904
#16 0x000055ddf28506a1 in JOIN::exec_inner (this=0x7f33d0014e00) at /data/src/10.4/sql/sql_select.cc:4459
#17 0x000055ddf284f7de in JOIN::exec (this=0x7f33d0014e00) at /data/src/10.4/sql/sql_select.cc:4241
#18 0x000055ddf2850ef3 in mysql_select (thd=0x7f33d0000af0, tables=0x7f33d0013970, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489926016, result=0x7f33d0014850, unit=0x7f33d0004a18, select_lex=0x7f33d0005210) at /data/src/10.4/sql/sql_select.cc:4673
#19 0x000055ddf2800f58 in mysql_execute_command (thd=0x7f33d0000af0) at /data/src/10.4/sql/sql_parse.cc:4784
#20 0x000055ddf280b509 in mysql_parse (thd=0x7f33d0000af0, rawbuf=0x7f33d0013198 "DELETE t2.* FROM t1, t2", length=23, parser_state=0x7f341e30c570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900
#21 0x000055ddf27f7ab9 in dispatch_command (command=COM_QUERY, thd=0x7f33d0000af0, packet=0x7f33d00083a1 "DELETE t2.* FROM t1, t2", packet_length=23, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
#22 0x000055ddf27f625b in do_command (thd=0x7f33d0000af0) at /data/src/10.4/sql/sql_parse.cc:1360
#23 0x000055ddf297de6a in do_handle_one_connection (connect=0x55ddf6a1d210) at /data/src/10.4/sql/sql_connect.cc:1412
#24 0x000055ddf297dbb9 in handle_one_connection (arg=0x55ddf6a1d210) at /data/src/10.4/sql/sql_connect.cc:1316
#25 0x000055ddf337b291 in pfs_spawn_thread (arg=0x55ddf6d11590) at /data/src/10.4/storage/perfschema/pfs.cc:1869
#26 0x00007f342aef74a4 in start_thread (arg=0x7f341e30d700) at pthread_create.c:456
#27 0x00007f342902bd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

With MyISAM

--source include/have_partition.inc
 
CREATE TABLE t1 (a INT);
INSERT  INTO t1 VALUES (1),(2),(3),(4),(5),(6);
 
CREATE TABLE t2 (f BLOB UNIQUE) WITH SYSTEM VERSIONING PARTITION BY system_time INTERVAL 1 WEEK (PARTITION p1 HISTORY, PARTITION pn CURRENT);
INSERT INTO t2 VALUES (NULL),('');
 
DELETE t2.* FROM t1, t2;
 
# Cleanup
DROP TABLE t1, t2;

10.4 non-debug dc22acfd

mysqltest: At line 9: query 'DELETE t2.* FROM t1, t2' failed: 126: Index for table './test/t2#P#p1.MYI' is corrupt; try to repair it

Debug assertion bitmap_is_set(&(m_part_info->read_partitions), m_last_part) fails both with InnoDB and MyISAM. Non-debug build produces an assertion failure with InnoDB and error 126 with MyISAM.

Reproducible with 10.4, 10.5.

Without partitioning the test cases cause the debug assertion



 Comments   
Comment by Elena Stepanova [ 2020-06-01 ]

On 10.5 the stack trace is just slightly different. I don't know if the difference is intended or a sign of a problem of it's own. It is from the exact same test case as in the description (InnoDB version);

10.5 non-debug f67522ed

2020-06-01 16:08:29 0x7f26145c0700  InnoDB: Assertion failure in file /data/src/10.5/storage/innobase/row/row0mysql.cc line 1854
InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON
 
#6  0x000055b7a707f643 in ut_dbg_assertion_failed (expr=expr@entry=0x55b7a7ccf970 "node->pcur->rel_pos == BTR_PCUR_ON", file=file@entry=0x55b7a7ccf1d8 "/data/src/10.5/storage/innobase/row/row0mysql.cc", line=line@entry=1854) at /data/src/10.5/storage/innobase/ut/ut0dbg.cc:60
#7  0x000055b7a776a3a7 in row_update_for_mysql (prebuilt=0x7f25d8041e20) at /data/src/10.5/storage/innobase/row/row0mysql.cc:1854
#8  0x000055b7a769b4d9 in ha_innobase::delete_row (this=0x7f25d803ee70, record=0x7f25d8047de0 "\374") at /data/src/10.5/storage/innobase/handler/ha_innodb.cc:8649
#9  0x000055b7a739401f in handler::ha_delete_row (this=0x7f25d803ee70, buf=0x7f25d8047de0 "\374") at /data/src/10.5/sql/handler.cc:7115
#10 0x000055b7a739401f in handler::ha_delete_row (this=0x7f25d803e5d0, buf=0x7f25d8047de0 "\374") at /data/src/10.5/sql/handler.cc:7115
#11 0x000055b7a74d2617 in TABLE::delete_row (this=0x7f25d803d7d8) at /data/src/10.5/sql/sql_delete.cc:277
#12 multi_delete::send_data (this=0x7f25d8011910, values=...) at /data/src/10.5/sql/sql_delete.cc:1330
#13 0x000055b7a71d55ae in select_result_sink::send_data_with_check (sent=<optimized out>, u=<optimized out>, items=..., this=<optimized out>) at /data/src/10.5/sql/sql_class.h:5284
#14 end_send (join=0x7f25d8011f10, join_tab=0x7f25d8014e50, end_of_records=<optimized out>) at /data/src/10.5/sql/sql_select.cc:21818
#15 0x000055b7a71b6ac6 in evaluate_join_record (join=join@entry=0x7f25d8011f10, join_tab=join_tab@entry=0x7f25d8014aa8, error=error@entry=0) at /data/src/10.5/sql/sql_select.cc:20849
#16 0x000055b7a71c5b7b in sub_select (join=0x7f25d8011f10, join_tab=0x7f25d8014aa8, end_of_records=<optimized out>) at /data/src/10.5/sql/sql_select.cc:20665
#17 0x000055b7a71b6ac6 in evaluate_join_record (join=join@entry=0x7f25d8011f10, join_tab=join_tab@entry=0x7f25d8014700, error=error@entry=0) at /data/src/10.5/sql/sql_select.cc:20849
#18 0x000055b7a71c5b7b in sub_select (join=0x7f25d8011f10, join_tab=0x7f25d8014700, end_of_records=<optimized out>) at /data/src/10.5/sql/sql_select.cc:20665
#19 0x000055b7a71e77f0 in do_select (procedure=<optimized out>, join=0x7f25d8011f10) at /data/src/10.5/sql/sql_select.cc:20160
#20 JOIN::exec_inner (this=this@entry=0x7f25d8011f10) at /data/src/10.5/sql/sql_select.cc:4475
#21 0x000055b7a71e7a47 in JOIN::exec (this=this@entry=0x7f25d8011f10) at /data/src/10.5/sql/sql_select.cc:4256
#22 0x000055b7a71e5df6 in mysql_select (thd=thd@entry=0x7f25d80009b8, tables=0x7f25d8010a08, fields=..., conds=conds@entry=0x0, og_num=og_num@entry=0, order=order@entry=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2202244746112, result=0x7f25d8011910, unit=0x7f25d8004810, select_lex=0x7f25d8005010) at /data/src/10.5/sql/sql_select.cc:4680
#23 0x000055b7a71897fa in mysql_execute_command (thd=thd@entry=0x7f25d80009b8) at /data/src/10.5/sql/sql_parse.cc:4844
#24 0x000055b7a718ec8c in mysql_parse (thd=thd@entry=0x7f25d80009b8, rawbuf=<optimized out>, length=23, parser_state=parser_state@entry=0x7f26145bf500, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.5/sql/sql_parse.cc:7992
#25 0x000055b7a7184ac8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f25d80009b8, packet=packet@entry=0x7f25d8007c79 "DELETE t2.* FROM t1, t2", packet_length=packet_length@entry=23, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.5/sql/sql_parse.cc:1875
#26 0x000055b7a7182e7e in do_command (thd=0x7f25d80009b8) at /data/src/10.5/sql/sql_parse.cc:1356
#27 0x000055b7a72796c0 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b7a9c0ba98, put_in_cache=put_in_cache@entry=true) at /data/src/10.5/sql/sql_connect.cc:1411
#28 0x000055b7a7279d24 in handle_one_connection (arg=arg@entry=0x55b7a9c0ba98) at /data/src/10.5/sql/sql_connect.cc:1313
#29 0x000055b7a75e7161 in pfs_spawn_thread (arg=0x55b7a9c85798) at /data/src/10.5/storage/perfschema/pfs.cc:2201
#30 0x00007f26238824a4 in start_thread (arg=0x7f26145c0700) at pthread_create.c:456
#31 0x00007f2622900d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

The difference is in the 10th frame, in 10.4 it refers to ha_partition::delete_row, while in 10.5 it repeats handler::ha_delete_row (so in fact there is no reference to partitioning in this stack trace at all).

Comment by Roel Van de Paar [ 2022-03-08 ]

CREATE TABLE t (pk INT KEY) ENGINE=InnoDB WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 100 (PARTITION p HISTORY,PARTITION pn CURRENT);
XA START 'a';
SET TIMESTAMP=130000;
INSERT INTO t VALUES (1);
DELETE FROM t;
INSERT INTO t VALUES (1);
DELETE FROM t;

Leads to:

10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Optimized)

InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON

10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Optimized)

Core was generated by `/test/MD260222-mariadb-10.9.0-linux-x86_64-opt/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 0x15268c1c0700 (LWP 2636916))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00001526a1826859 in __GI_abort () at abort.c:79
#2  0x00005632858b19a5 in ut_dbg_assertion_failed (expr=expr@entry=0x563286541130 "node->pcur->rel_pos == BTR_PCUR_ON", file=file@entry=0x563286540aa0 "/test/10.9_opt/storage/innobase/row/row0mysql.cc", line=line@entry=1668) at /test/10.9_opt/storage/innobase/ut/ut0dbg.cc:60
#3  0x00005632858a4e88 in row_update_for_mysql (prebuilt=<optimized out>) at /test/10.9_opt/storage/innobase/row/row0mysql.cc:1668
#4  0x0000563285f5d507 in ha_innobase::delete_row (this=0x1525f002a860, record=0x1525f0017410 "\377\001") at /test/10.9_opt/storage/innobase/handler/ha_innodb.cc:8719
#5  0x0000563285c6e5ef in handler::ha_delete_row (this=0x1525f002a860, buf=0x1525f0017410 "\377\001") at /test/10.9_opt/sql/handler.cc:7654
#6  0x0000563285c6e5ef in handler::ha_delete_row (this=0x1525f002a010, buf=0x1525f0017410 "\377\001") at /test/10.9_opt/sql/handler.cc:7654
#7  0x00005632859ca7ef in mysql_delete (thd=thd@entry=0x1525f0000c58, table_list=<optimized out>, conds=<optimized out>, order_list=order_list@entry=0x1525f0005988, limit=18446744073709551615, options=<optimized out>, result=<optimized out>) at /test/10.9_opt/sql/sql_delete.cc:833
#8  0x0000563285a19d80 in mysql_execute_command (thd=0x1525f0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.9_opt/sql/sql_limit.h:85
#9  0x0000563285a07e26 in mysql_parse (thd=0x1525f0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.9_opt/sql/sql_parse.cc:8027
#10 0x0000563285a13fd5 in dispatch_command (command=COM_QUERY, thd=0x1525f0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.9_opt/sql/sql_class.h:1362
#11 0x0000563285a161c7 in do_command (thd=0x1525f0000c58, blocking=blocking@entry=true) at /test/10.9_opt/sql/sql_parse.cc:1402
#12 0x0000563285b35b47 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.9_opt/sql/sql_connect.cc:1418
#13 0x0000563285b35e8d in handle_one_connection (arg=arg@entry=0x56328838b9f8) at /test/10.9_opt/sql/sql_connect.cc:1312
#14 0x0000563285eaf631 in pfs_spawn_thread (arg=0x563288320948) at /test/10.9_opt/storage/perfschema/pfs.cc:2201
#15 0x00001526a1d37609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#16 0x00001526a1923163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

mysqld: /test/10.9_dbg/sql/ha_partition.cc:4690: virtual int ha_partition::delete_row(const uchar*): Assertion `bitmap_is_set(&(m_part_info->read_partitions), m_last_part)' failed.

10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

Core was generated by `/test/MD260222-mariadb-10.9.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 0x147dc41b0700 (LWP 2637405))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000147ddb447859 in __GI_abort () at abort.c:79
#2  0x0000147ddb447729 in __assert_fail_base (fmt=0x147ddb5dd588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x564d687b7ad0 "bitmap_is_set(&(m_part_info->read_partitions), m_last_part)", file=0x564d687b6cb0 "/test/10.9_dbg/sql/ha_partition.cc", line=4690, function=<optimized out>) at assert.c:92
#3  0x0000147ddb459006 in __GI___assert_fail (assertion=assertion@entry=0x564d687b7ad0 "bitmap_is_set(&(m_part_info->read_partitions), m_last_part)", file=file@entry=0x564d687b6cb0 "/test/10.9_dbg/sql/ha_partition.cc", line=line@entry=4690, function=function@entry=0x564d687b7bc8 "virtual int ha_partition::delete_row(const uchar*)") at assert.c:101
#4  0x0000564d67ebb8d1 in ha_partition::delete_row (this=0x147d64024a90, buf=0x147d64024620 "\377\001") at /test/10.9_dbg/sql/ha_partition.cc:4690
#5  0x0000564d67bf0f5c in handler::ha_delete_row (this=0x147d64024a90, buf=0x147d64024620 "\377\001") at /test/10.9_dbg/sql/handler.cc:7654
#6  0x0000564d67878a54 in TABLE::delete_row (this=0x147d64030e18) at /test/10.9_dbg/sql/sql_delete.cc:292
#7  0x0000564d678769f7 in mysql_delete (thd=thd@entry=0x147d64000db8, table_list=0x147d64013ea0, conds=<optimized out>, order_list=order_list@entry=0x147d64005ca8, limit=18446744073709551615, options=<optimized out>, result=<optimized out>) at /test/10.9_dbg/sql/sql_delete.cc:833
#8  0x0000564d678d9495 in mysql_execute_command (thd=thd@entry=0x147d64000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_limit.h:85
#9  0x0000564d678c3343 in mysql_parse (thd=thd@entry=0x147d64000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147dc41af400) at /test/10.9_dbg/sql/sql_parse.cc:8027
#10 0x0000564d678d1fdf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147d64000db8, packet=packet@entry=0x147d6400b889 "DELETE FROM t", packet_length=packet_length@entry=13, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362
#11 0x0000564d678d5426 in do_command (thd=0x147d64000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402
#12 0x0000564d67a50036 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564d6b9854b8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
#13 0x0000564d67a5063b in handle_one_connection (arg=arg@entry=0x564d6b9854b8) at /test/10.9_dbg/sql/sql_connect.cc:1312
#14 0x0000564d67ed6d23 in pfs_spawn_thread (arg=0x564d6b8986d8) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201
#15 0x0000147ddb958609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#16 0x0000147ddb544163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)

Comment by Alice Sherepa [ 2023-07-27 ]

still reproducible on 10.4 9854fb6fa7ceabdf9968a1, but not on 10.5+

Comment by Roel Van de Paar [ 2023-07-30 ]

This still crashes a 10.6 build from 28 July 23 (testcase):

10.6.15 b102872ad50cce5959ad95369740766d14e9e48c (Optimized)

InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON

10.6.15 b102872ad50cce5959ad95369740766d14e9e48c (Optimized)

Core was generated by `/test/MD280723-mariadb-10.6.15-linux-x86_64-opt/bin/mariadbd --no-defaults --co'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22575425476160)
    at ./nptl/pthread_kill.c:44
[Current thread is 1 (Thread 0x148840375640 (LWP 624866))]
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22575425476160) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=22575425476160) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=22575425476160, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x000014886ca42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x000014886ca287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x000055a59a852367 in ut_dbg_assertion_failed (expr=expr@entry=0x55a59b3e5a80 "node->pcur->rel_pos == BTR_PCUR_ON", file=file@entry=0x55a59b3e5400 "/test/10.6_opt/storage/innobase/row/row0mysql.cc", line=line@entry=1659) at /test/10.6_opt/storage/innobase/ut/ut0dbg.cc:60
#6  0x000055a59a844ade in row_update_for_mysql (prebuilt=0x14882002d7a8) at /test/10.6_opt/storage/innobase/row/row0mysql.cc:1659
#7  0x000055a59ae789e2 in ha_innobase::delete_row (this=0x14882002afa0, record=0x14882001ac70 "\377\001") at /test/10.6_opt/storage/innobase/handler/ha_innodb.cc:8814
#8  0x000055a59abd1ee3 in handler::ha_delete_row (this=0x14882002afa0, buf=0x14882001ac70 "\377\001") at /test/10.6_opt/sql/handler.cc:7768
#9  0x000055a59abd1ee3 in handler::ha_delete_row (this=0x14882002a6e0, buf=0x14882001ac70 "\377\001") at /test/10.6_opt/sql/handler.cc:7768
#10 0x000055a59ad417b2 in mysql_delete (thd=thd@entry=0x148820000c68, table_list=<optimized out>, conds=<optimized out>, order_list=order_list@entry=0x148820005770, limit=18446744073709551615, options=<optimized out>, result=<optimized out>) at /test/10.6_opt/sql/sql_delete.cc:839
#11 0x000055a59a991944 in mysql_execute_command (thd=0x148820000c68, is_called_from_prepared_stmt=<optimized out>) at /test/10.6_opt/sql/sql_limit.h:94
#12 0x000055a59a994dd4 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x148820000c68) at /test/10.6_opt/sql/sql_parse.cc:8041
#13 mysql_parse (thd=0x148820000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:7963
#14 0x000055a59a997422 in dispatch_command (command=COM_QUERY, thd=0x148820000c68, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:1993
#15 0x000055a59a998ca0 in do_command (thd=0x148820000c68, blocking=blocking@entry=true) at /test/10.6_opt/sql/sql_parse.cc:1409
#16 0x000055a59aa9e827 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55a59d5162e8, put_in_cache=put_in_cache@entry=true) at /test/10.6_opt/sql/sql_connect.cc:1416
#17 0x000055a59aa9eafd in handle_one_connection (arg=0x55a59d5162e8) at /test/10.6_opt/sql/sql_connect.cc:1318
#18 0x000014886ca94b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#19 0x000014886cb26a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Also this looks off:

11.1.2 3883eb63dc5e663558571c33d086c9fd3aa0cf8f (Debug)

11.1.2-dbg>CREATE TABLE t (pk INT KEY) ENGINE=InnoDB WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 100 (PARTITION p HISTORY,PARTITION pn CURRENT);
Query OK, 0 rows affected (0.019 sec)
 
11.1.2-dbg>XA START 'a';
Query OK, 0 rows affected (0.000 sec)
 
11.1.2-dbg>SET TIMESTAMP=130000;
Query OK, 0 rows affected (0.000 sec)
 
11.1.2-dbg>INSERT INTO t VALUES (1);
Query OK, 1 row affected (0.004 sec)
 
11.1.2-dbg>DELETE FROM t;
Query OK, 1 row affected (0.001 sec)
 
11.1.2-dbg>INSERT INTO t VALUES (1);
Query OK, 1 row affected (0.000 sec)
 
11.1.2-dbg>DELETE FROM t;
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'

Without the SET TIMESTAMP=130000; there are no errors, all queries process OK.

Generated at Thu Feb 08 09:16:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.