1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-29068 Cascade foreign key updates do not apply in online alter

This commit is contained in:
Nikita Malyavin
2022-10-21 15:08:26 +03:00
committed by Sergei Golubchik
parent 84ed2e7ce6
commit b08b78c5b9
3 changed files with 103 additions and 0 deletions

View File

@ -10071,6 +10071,18 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
online= online && !table->s->tmp_table;
List<FOREIGN_KEY_INFO> fk_list;
table->file->get_foreign_key_list(thd, &fk_list);
for (auto &fk: fk_list)
{
if (fk_modifies_child(fk.delete_method)
|| fk_modifies_child(fk.update_method))
{
online= false;
break;
}
}
#ifdef WITH_WSREP
if (WSREP(thd) &&
(thd->lex->sql_command == SQLCOM_ALTER_TABLE ||