diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-23 19:33:55 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-23 19:33:55 +0300 |
commit | 9f19dbe0c3f6bc3ee68c336869c186dd820107c0 (patch) | |
tree | 57a03d35115b6375c63c9681ec07afd74730f85e | |
parent | e52a36d37be2fa8a2da8a987cb38cb0bb65233f4 (diff) | |
download | mariadb-git-9f19dbe0c3f6bc3ee68c336869c186dd820107c0.tar.gz |
MDEV-22358 Assertion srv_undo_sources || ... in row_prebuilt_free()
row_prebuilt_free(): Do not attempt to drop orphan indexes
that might have been left behind by a failed ADD UNIQUE INDEX.
This avoids the execution of unwanted transactions during shutdown.
-rw-r--r-- | mysql-test/suite/innodb_fts/r/innodb_fts_misc.result | 7 | ||||
-rw-r--r-- | mysql-test/suite/innodb_fts/t/innodb_fts_misc.test | 8 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 2 |
3 files changed, 14 insertions, 3 deletions
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result index 8c3c3b5be68..8074260952a 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result +++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc.result @@ -740,6 +740,11 @@ FULLTEXT(f2), FOREIGN KEY(f1) REFERENCES mdev20987_1(f1))ENGINE=InnoDB; INSERT INTO mdev20987_1 VALUES(1); INSERT INTO mdev20987_2 VALUES(1, 'mariadb'); +CREATE TABLE mdev22358 (a INT, b TEXT, FULLTEXT KEY ftidx (b)) ENGINE=InnoDB; +ALTER TABLE mdev22358 DROP KEY ftidx; +INSERT INTO mdev22358 (a) VALUES (2),(2); +ALTER TABLE mdev22358 ADD UNIQUE KEY uidx (a), ADD FULLTEXT KEY ftidx (b); +ERROR 23000: Duplicate entry '2' for key 'uidx' SHOW CREATE TABLE t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -747,7 +752,7 @@ t2 CREATE TABLE `t2` ( PRIMARY KEY (`FTS_DOC_ID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DELETE FROM t1 WHERE MATCH(char_column) AGAINST ('bbb'); -DROP TABLE t1, t2, mdev20987_2, mdev20987_1; +DROP TABLE t1, t2, mdev20987_2, mdev20987_1, mdev22358; "----------Test28---------" create table `fts_test`(`a` text,fulltext key(`a`))engine=innodb; set session autocommit=0; diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test index 5b11a418dab..d1c6063d524 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test +++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test @@ -672,10 +672,16 @@ CREATE TABLE mdev20987_2(f1 INT NOT NULL, f2 CHAR(100), FOREIGN KEY(f1) REFERENCES mdev20987_1(f1))ENGINE=InnoDB; INSERT INTO mdev20987_1 VALUES(1); INSERT INTO mdev20987_2 VALUES(1, 'mariadb'); + +CREATE TABLE mdev22358 (a INT, b TEXT, FULLTEXT KEY ftidx (b)) ENGINE=InnoDB; +ALTER TABLE mdev22358 DROP KEY ftidx; +INSERT INTO mdev22358 (a) VALUES (2),(2); +--error ER_DUP_ENTRY +ALTER TABLE mdev22358 ADD UNIQUE KEY uidx (a), ADD FULLTEXT KEY ftidx (b); --source include/restart_mysqld.inc SHOW CREATE TABLE t2; DELETE FROM t1 WHERE MATCH(char_column) AGAINST ('bbb'); -DROP TABLE t1, t2, mdev20987_2, mdev20987_1; +DROP TABLE t1, t2, mdev20987_2, mdev20987_1, mdev22358; --echo "----------Test28---------" create table `fts_test`(`a` text,fulltext key(`a`))engine=innodb; diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index c708842b04d..ac44e32c326 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -1033,7 +1033,7 @@ row_prebuilt_free( rtr_clean_rtr_info(prebuilt->rtr_info, true); } if (prebuilt->table) { - dict_table_close(prebuilt->table, dict_locked, TRUE); + dict_table_close(prebuilt->table, dict_locked, FALSE); } mem_heap_free(prebuilt->heap); |