mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-26052 Assertion prebuilt->trx_id < table->def_trx_id failed
ha_innobase::truncate(): If the operation fails, preserve
also dict_table_t::def_trx_id.
This fixes a regression that had been introduced in
commit 1bd681c8b3
(MDEV-25506).
This commit is contained in:
@@ -68,3 +68,21 @@ TRUNCATE TABLE t1;
|
||||
ALTER TABLE t1 ADD c INT;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-26052 Assertion prebuilt->trx_id < table->def_trx_id failed
|
||||
#
|
||||
call mtr.add_suppression("InnoDB: In ALTER TABLE `test`\\.`t1` has or is");
|
||||
CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a)) ENGINE=InnoDB;
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a), ALGORITHM=COPY;
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
LOCK TABLES t1 WRITE;
|
||||
TRUNCATE t1;
|
||||
ERROR HY000: Cannot add foreign key constraint for `t1`
|
||||
INSERT INTO t1 VALUES (2,2);
|
||||
SELECT * FROM t1;
|
||||
pk a
|
||||
1 1
|
||||
2 2
|
||||
DROP TABLE t1;
|
||||
# End of 10.6 tests
|
||||
|
Reference in New Issue
Block a user