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:
committed by
Sergei Golubchik
parent
84ed2e7ce6
commit
b08b78c5b9
@ -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 ||
|
||||
|
Reference in New Issue
Block a user