1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-26053 : TRUNCATE on table with Foreign Key Constraint no longer replicated to other nodes

Problem was that there was extra condition !thd->lex->no_write_to_binlog
before call to begin TOI. It seems that this variable is not initialized.
TRUNCATE does not support [NO_WRITE_TO_BINLOG | LOCAL] keywords, thus
we should not check this condition. All this was hidden in a macro,
so I decided to remove those macros that were used only a few places
with actual function calls.
This commit is contained in:
Jan Lindström
2021-09-16 12:14:39 +03:00
parent 5b0a76078a
commit d3b35598fc
6 changed files with 102 additions and 23 deletions

View File

@ -466,16 +466,17 @@ static bool wsrep_toi_replication(THD *thd, TABLE_LIST *tables)
/* now TOI replication, with no locks held */
if (keys.empty())
{
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, tables);
} else {
WSREP_TO_ISOLATION_BEGIN_FK_TABLES(NULL, NULL, tables, &keys) {
if (!thd->lex->no_write_to_binlog &&
wsrep_to_isolation_begin(thd, NULL, NULL, tables))
return true;
}
else
{
if (!thd->lex->no_write_to_binlog &&
wsrep_to_isolation_begin(thd, NULL, NULL, tables, NULL, &keys))
return true;
}
}
return false;
wsrep_error_label:
return true;
}
#endif /* WITH_WSREP */