Skip to content

Commit

Permalink
MDEV-17432 Assertion `lock_trx_has_sys_table_locks(trx) == 0' failed …
Browse files Browse the repository at this point in the history
…upon ALTER TABLE .. ADD FOREIGN KEY

- This is a regression of commit b26e603. While dropping
the incompletely created table, InnoDB shouldn't consider that operation as non-atomic one.
  • Loading branch information
Thirunarayanan committed Dec 2, 2018
1 parent 4696036 commit f2c7972
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions mysql-test/suite/innodb/t/table_flags.test
Expand Up @@ -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;
3 changes: 2 additions & 1 deletion storage/innobase/handler/ha_innodb.cc
Expand Up @@ -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);
Expand Down

0 comments on commit f2c7972

Please sign in to comment.