[MDEV-27953] Assertion `!check_unique_secondary' failed in trx_t::check_bulk_buffer Created: 2022-02-26  Updated: 2022-07-28  Resolved: 2022-07-26

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.7, 10.8, 10.9
Fix Version/s: 10.7.5

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Thirunarayanan Balathandayuthapani
Resolution: Duplicate Votes: 0
Labels: not-10.2, not-10.3, not-10.4, not-10.5, not-10.6, regression

Issue Links:
Duplicate
duplicates MDEV-28242 Assertion `!check_foreigns' failed in... Closed
Problem/Incident
is caused by MDEV-24621 In bulk insert, pre-sort and build in... Closed
Relates
relates to MDEV-27470 SEGV around trx_undo_report_row_opera... Closed
relates to MDEV-27890 SIGSEGV in innobase_get_mysql_key_num... Closed

 Description   

# Repeat till it crashes
DROP DATABASE test;
CREATE DATABASE test;
USE test;
CREATE TABLE t1 (a INT,b INT,c INT,d INT,PRIMARY KEY(a),KEY(b),KEY(c),KEY(d)) ENGINE=InnoDB;
SET unique_checks=0,foreign_key_checks=0,autocommit=0;
INSERT INTO t1 VALUES (0,0,0,0);
SET @@unique_checks=1;
CREATE TEMPORARY SEQUENCE s1;

Leads to:

10.9.0 4a2a9c02cd6611ef36bbb735c2b483dbc83580d4 (Debug)

mysqld: /test/10.9_dbg/storage/innobase/include/trx0trx.h:1114: trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*): Assertion `!check_unique_secondary' 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 0x154ad4141700 (LWP 2091611))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000154addfa5859 in __GI_abort () at abort.c:79
#2  0x0000154addfa5729 in __assert_fail_base (fmt=0x154ade13b588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x560647c88b4c "!check_unique_secondary", file=0x560647c8e278 "/test/10.9_dbg/storage/innobase/include/trx0trx.h", line=1114, function=<optimized out>) at assert.c:92
#3  0x0000154addfb6f36 in __GI___assert_fail (assertion=assertion@entry=0x560647c88b4c "!check_unique_secondary", file=file@entry=0x560647c8e278 "/test/10.9_dbg/storage/innobase/include/trx0trx.h", line=line@entry=1114, function=function@entry=0x560647cc8478 "trx_mod_table_time_t* trx_t::check_bulk_buffer(dict_table_t*)") at assert.c:101
#4  0x000056064757a435 in trx_t::check_bulk_buffer (table=<optimized out>, this=0x154ad4dd91e0) at /test/10.9_dbg/storage/innobase/include/trx0trx.h:1114
#5  row_ins_index_entry (thr=0x154a88522dd0, entry=0x154a88027ca8, index=0x154a88520698) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3379
#6  row_ins_index_entry_step (thr=0x154a88522dd0, node=0x154a88522ad8) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3556
#7  row_ins (thr=0x154a88522dd0, node=0x154a88522ad8) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3702
#8  row_ins_step (thr=thr@entry=0x154a88522dd0) at /test/10.9_dbg/storage/innobase/row/row0ins.cc:3848
#9  0x000056064759e85c in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x154a8851f038 "\377\001", prebuilt=0x154a88522498, ins_mode=ROW_INS_NORMAL) at /test/10.9_dbg/storage/innobase/row/row0mysql.cc:1318
#10 0x0000560647419edb in ha_innobase::write_row (this=0x154a88520f10, record=0x154a8851f038 "\377\001") at /test/10.9_dbg/storage/innobase/handler/ha_innodb.cc:7846
#11 0x00005606473b8150 in ha_sequence::write_row (this=0x154a8851f4c0, buf=0x154a8851f038 "\377\001") at /test/10.9_dbg/sql/ha_sequence.cc:223
#12 0x00005606470733e7 in handler::ha_write_row (this=0x154a8851f4c0, buf=0x154a8851f038 "\377\001") at /test/10.9_dbg/sql/handler.cc:7522
#13 0x0000560646fab2d8 in sequence_definition::write_initial_sequence (this=this@entry=0x154a880145c0, table=0x154a8851ebe8) at /test/10.9_dbg/sql/sql_sequence.cc:617
#14 0x0000560646fab4cd in sequence_insert (thd=thd@entry=0x154a88000db8, lex=0x154a880050f0, org_table_list=org_table_list@entry=0x154a88013ed8) at /test/10.9_dbg/sql/sql_sequence.cc:367
#15 0x0000560646e447fc in mysql_create_table_no_lock (thd=thd@entry=0x154a88000db8, ddl_log_state_create=ddl_log_state_create@entry=0x154ad413f920, ddl_log_state_rm=ddl_log_state_rm@entry=0x154ad413f940, db=db@entry=0x154a88013ef0, table_name=table_name@entry=0x154a88013f00, create_info=create_info@entry=0x154ad413fbc0, alter_info=0x154ad413fad0, is_trans=0x154ad413f91f, create_table_mode=0, table_list=0x154a88013ed8) at /test/10.9_dbg/sql/sql_table.cc:4724
#16 0x0000560646e44bc0 in mysql_create_table (thd=thd@entry=0x154a88000db8, create_table=create_table@entry=0x154a88013ed8, create_info=create_info@entry=0x154ad413fbc0, alter_info=alter_info@entry=0x154ad413fad0) at /test/10.9_dbg/sql/sql_table.cc:4822
#17 0x0000560646e46a78 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x154a88000db8) at /test/10.9_dbg/sql/sql_table.cc:12323
#18 0x0000560646d5f83c in mysql_execute_command (thd=thd@entry=0x154a88000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/sql_parse.cc:5988
#19 0x0000560646d46343 in mysql_parse (thd=thd@entry=0x154a88000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x154ad4140400) at /test/10.9_dbg/sql/sql_parse.cc:8027
#20 0x0000560646d54fdf in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154a88000db8, packet=packet@entry=0x154a8800b889 "CREATE TEMPORARY SEQUENCE s1", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362
#21 0x0000560646d58426 in do_command (thd=0x154a88000db8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_parse.cc:1402
#22 0x0000560646ed3036 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5606497852b8, put_in_cache=put_in_cache@entry=true) at /test/10.9_dbg/sql/sql_connect.cc:1418
#23 0x0000560646ed363b in handle_one_connection (arg=arg@entry=0x5606497852b8) at /test/10.9_dbg/sql/sql_connect.cc:1312
#24 0x0000560647359d23 in pfs_spawn_thread (arg=0x560649698848) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201
#25 0x0000154ade4b4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#26 0x0000154ade0a2293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.7.4 (dbg), 10.8.3 (dbg), 10.9.0 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 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 (opt), 10.8.3 (opt), 10.9.0 (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)


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