summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-10-24 11:04:38 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-10-25 13:03:29 +0300
commit5dd3b52f950d688bbe9ea2e8cd10b5206198a096 (patch)
tree1c3bcb78f74e51c1ba8dbaafe9f8af68690e9238 /storage/innobase
parent642394197e397fa73d776ee1fecdbd07f54607ff (diff)
downloadmariadb-git-5dd3b52f950d688bbe9ea2e8cd10b5206198a096.tar.gz
MDEV-17531 Crash in RENAME TABLE with FOREIGN KEY and FULLTEXT INDEX
In RENAME TABLE, when an error occurs while renaming FOREIGN KEY constraint, that error would be overwritten when renaming the InnoDB internal tables related to FULLTEXT INDEX. row_rename_table_for_mysql(): Do not attempt to rename the internal tables if an error already occurred. This problem was originally reported as Oracle Bug#27545888.
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/row/row0mysql.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 87d40ee2ba4..c997c9f98ab 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -5154,8 +5154,9 @@ row_rename_table_for_mysql(
}
}
- if ((dict_table_has_fts_index(table)
- || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID))
+ if (err == DB_SUCCESS
+ && (dict_table_has_fts_index(table)
+ || DICT_TF2_FLAG_IS_SET(table, DICT_TF2_FTS_HAS_DOC_ID))
&& !dict_tables_have_same_db(old_name, new_name)) {
err = fts_rename_aux_tables(table, new_name, trx);
if (err != DB_TABLE_NOT_FOUND) {