mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge branch '10.4' into 10.5
This commit is contained in:
@ -427,20 +427,23 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
|
||||
bool hton_can_recreate;
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd))
|
||||
if (WSREP(thd) && wsrep_thd_is_local(thd))
|
||||
{
|
||||
wsrep::key_array keys;
|
||||
wsrep_append_fk_parent_table(thd, table_ref, &keys);
|
||||
if (keys.empty())
|
||||
/* Do not start TOI if table is not found */
|
||||
if (!wsrep_append_fk_parent_table(thd, table_ref, &keys))
|
||||
{
|
||||
WSREP_TO_ISOLATION_BEGIN_IF(table_ref->db.str, table_ref->table_name.str, NULL)
|
||||
if (keys.empty())
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
} else {
|
||||
WSREP_TO_ISOLATION_BEGIN_FK_TABLES(NULL, NULL, table_ref, &keys)
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
WSREP_TO_ISOLATION_BEGIN_IF(table_ref->db.str, table_ref->table_name.str, NULL)
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
} else {
|
||||
WSREP_TO_ISOLATION_BEGIN_FK_TABLES(NULL, NULL, table_ref, &keys)
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user