summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2021-09-16 12:14:39 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2021-09-17 07:18:37 +0300
commitd3b35598fcf8c83c8e2c1a004d507c95a42eb174 (patch)
treeafcec62030cd180a9410138b7da1fc0d753441c5 /sql/sql_admin.cc
parent5b0a76078a8ea38e8e19e3e2c49f0f7e091e2f72 (diff)
downloadmariadb-git-d3b35598fcf8c83c8e2c1a004d507c95a42eb174.tar.gz
MDEV-26053 : TRUNCATE on table with Foreign Key Constraint no longer replicated to other nodesbb-10.4-truncate
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.
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index b626200d297..f692afb1440 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -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 */