Skip to content

Commit

Permalink
Bug #27545888 MYSQLD CRASHES WHEN RENAMING AN INNODB TABLE WITH FOREIGN
Browse files Browse the repository at this point in the history
KEY AND FULLTEXT KEY

PROBLEM

When renaming a table, foreign key constraint name is duplicated and is
not handled therefore crashes later during query execution.

FIX

Handle the particulary duplicate key error case by exiting function and
return error to server.

NOTE: For 8.0+, Added to this issue fixed another issue that we are writing
rename log in case of rollback also so made the call to
row_rename_table_for_mysql based on the replay hint coming from
fts_rename_aux_tables.
Also added crash injection test incase of rename table crash/recovery
rollback.

Reviewd by: Jimmy Yang< Jimmy.Yang@oracle.com>
	    Bin su <bin.x.su@oracle.com>

RB: 19785 & 19828
  • Loading branch information
Aakanksha Verma committed Jul 11, 2018
1 parent 51f1b83 commit cdc1d6e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions storage/innobase/row/row0mysql.cc
Expand Up @@ -5066,6 +5066,9 @@ row_rename_table_for_mysql(
" = TO_BINARY(:old_table_name);\n"
"END;\n"
, FALSE, trx);
if (err != DB_SUCCESS) {
goto end;
}

} else if (n_constraints_to_drop > 0) {
/* Drop some constraints of tmp tables. */
Expand Down

0 comments on commit cdc1d6e

Please sign in to comment.