MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed upon ALTER TABLE .. ADD FOREIGN KEY

- This is a regression of commit b26e603aebc0c375751cc1d08029b3fb603a0373. While dropping
the incompletely created table, InnoDB shouldn't consider that operation as non-atomic one.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2018-12-03 01:12:04 +05:30
parent 46960365b1
commit f2c7972a3d
2 changed files with 8 additions and 1 deletions

View File

@ -207,3 +207,9 @@ DROP TABLE tr,tc,td,tz,tp;
--list_files $bugdir
--remove_files_wildcard $bugdir
--rmdir $bugdir
call mtr.add_suppression("ERROR HY000: Can't create table `test`.`t1`");
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1(f1 INT, f2 VARCHAR(1), KEY k1(f2),
FULLTEXT KEY(f2),
FOREIGN KEY (f2) REFERENCES t1(f3))ENGINE=InnoDB;

View File

@ -12865,7 +12865,8 @@ ha_innobase::create(
if (info.drop_before_rollback()) {
trx->error_state = DB_SUCCESS;
row_drop_table_for_mysql(info.table_name(),
trx, SQLCOM_TRUNCATE, true);
trx, SQLCOM_TRUNCATE, true,
false);
}
trx_rollback_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);