summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormkaruza <mario.karuza@galeracluster.com>2021-03-31 14:59:50 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-04-05 09:30:29 +0300
commitf8488370d6e4dc38643545260b17755bb8be8a9d (patch)
tree782a634636be773fd85270cff043bc9f3658b151 /sql
parent915983e1cc3a0a356a0adfef38fc7ad87264bd9f (diff)
downloadmariadb-git-f8488370d6e4dc38643545260b17755bb8be8a9d.tar.gz
MDEV-24956: ALTER TABLE not replicated with Galera in MariaDB 10.5.9bb-10.4-MDEV-25226
`WSREP_CLIENT` is used as condition for starting ALTER/OPTIMIZE/REPAIR TOI. Using this condition async replicated affected DDL's will not be replicated. Fixed by removing this condition. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_admin.cc11
-rw-r--r--sql/sql_alter.cc2
2 files changed, 7 insertions, 6 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index e59dffc10aa..a96eb58809b 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -447,8 +447,6 @@ dbug_err:
*/
static bool wsrep_toi_replication(THD *thd, TABLE_LIST *tables)
{
- if (!WSREP(thd) || !WSREP_CLIENT(thd)) return false;
-
LEX *lex= thd->lex;
/* only handle OPTIMIZE and REPAIR here */
switch (lex->sql_command)
@@ -549,10 +547,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
for (table= tables; table; table= table->next_local)
table->table= NULL;
#ifdef WITH_WSREP
- if (wsrep_toi_replication(thd, tables))
+ if (WSREP(thd))
{
- WSREP_INFO("wsrep TOI replication of has failed, skipping OPTIMIZE");
- goto err;
+ if(wsrep_toi_replication(thd, tables))
+ {
+ WSREP_INFO("wsrep TOI replication of has failed.");
+ goto err;
+ }
}
#endif /* WITH_WSREP */
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 2bbc8169df2..f1a67e7d968 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -471,7 +471,7 @@ bool Sql_cmd_alter_table::execute(THD *thd)
if (check_grant(thd, priv_needed, first_table, FALSE, UINT_MAX, FALSE))
DBUG_RETURN(TRUE); /* purecov: inspected */
#ifdef WITH_WSREP
- if (WSREP(thd) && WSREP_CLIENT(thd) &&
+ if (WSREP(thd) &&
(!thd->is_current_stmt_binlog_format_row() ||
!thd->find_temporary_table(first_table)))
{