summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-08-28 16:40:12 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2020-08-28 16:40:12 +0300
commitc710c450e3a5654244fffaabcb4ba5af2dd24dd9 (patch)
tree3a1cc44386b812c80dab56945eea5b8034553713 /sql/wsrep_mysqld.cc
parentdf07ea0b27f891c69e60b75869f474cd03232216 (diff)
downloadmariadb-git-c710c450e3a5654244fffaabcb4ba5af2dd24dd9.tar.gz
MDEV-21578 : CREATE OR REPLACE TRIGGER in Galera cluster not replicating
While doing TOI buffer OR REPLACE option was not added to replicated string.
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index f95ef168a23..d392d1c2a61 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2924,7 +2924,12 @@ static int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len)
definer_host.length= 0;
}
- stmt_query.append(STRING_WITH_LEN("CREATE "));
+ const LEX_STRING command[3]=
+ {{ C_STRING_WITH_LEN("CREATE ") },
+ { C_STRING_WITH_LEN("ALTER ") },
+ { C_STRING_WITH_LEN("CREATE OR REPLACE ") }};
+ stmt_query.append(command[thd->lex->create_view_mode].str,
+ command[thd->lex->create_view_mode].length);
append_definer(thd, &stmt_query, &definer_user, &definer_host);