[MDEV-26621] assertion failue "index->table->persistent_autoinc" in /storage/innobase/btr/btr0btr.cc during IMPORT Created: 2021-09-16  Updated: 2021-09-16  Resolved: 2021-09-16

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Storage Engine - InnoDB
Affects Version/s: 10.4, 10.5, 10.6
Fix Version/s: 10.4.22, 10.5.13, 10.6.5

Type: Bug Priority: Major
Reporter: Eugene Kosov (Inactive) Assignee: Eugene Kosov (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-18543 IMPORT TABLESPACE fails after instant... Closed

 Description   

--source include/have_innodb.inc
 
--let $MYSQLD_DATADIR= `SELECT @@datadir`
 
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT) ENGINE=INNODB;
CREATE TABLE t2 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT, i2 INT) ENGINE=INNODB;
 
ALTER TABLE t2 DROP COLUMN i2, ALGORITHM=INSTANT;
ALTER TABLE t2 DISCARD TABLESPACE;
 
FLUSH TABLE t1 FOR EXPORT;
 
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
 
UNLOCK TABLES;
 
ALTER TABLE t2 IMPORT TABLESPACE;
 
DROP TABLE t2, t1;

#7  0x00007f4eaafab7f2 in __GI___assert_fail (assertion=0x5ef979 "index->table->persistent_autoinc", file=0x5877eb "/home/kevgs/work/m/bb-10.4-kevgs/storage/innobase/btr/btr0btr.cc", line=1391, function=0x594c03 "void btr_write_autoinc(dict_index_t *, ib_uint64_t, bool)") at assert.c:101
#8  0x0000000001437e95 in btr_write_autoinc (index=0x7f4e580389a0, autoinc=0, reset=false) at btr0btr.cc:1391
#9  0x0000000001657a0e in row_import_for_mysql (table=0x7f4e58036c60, prebuilt=0x7f4e581728d0) at row0import.cc:4423
#10 0x00000000012c6012 in ha_innobase::discard_or_import_tablespace (this=0x7f4e580896c0, discard=0 '\000') at ha_innodb.cc:13111
#11 0x0000000000c9745d in handler::ha_discard_or_import_tablespace (this=0x7f4e580896c0, discard=0 '\000') at handler.cc:4611
#12 0x000000000101bc8c in mysql_discard_or_import_tablespace (thd=0x7f4e58000d28, table_list=0x7f4e580136e8, discard=false) at sql_table.cc:6062
#13 0x00000000010ce6c5 in Sql_cmd_discard_import_tablespace::execute (this=0x7f4e58013db8, thd=0x7f4e58000d28) at sql_alter.cc:557
#14 0x0000000000f2424e in mysql_execute_command (thd=0x7f4e58000d28) at sql_parse.cc:6192
#15 0x0000000000f116aa in mysql_parse (thd=0x7f4e58000d28, rawbuf=0x7f4e58013600 "ALTER TABLE t2 IMPORT TABLESPACE", length=32, parser_state=0x7f4ea9573628, is_com_multi=false, is_next_command=false) at sql_parse.cc:7995



 Comments   
Comment by Marko Mäkelä [ 2021-09-16 ]

Good catch. OK to push.

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