diff options
-rw-r--r-- | sql/events.cc | 27 | ||||
-rw-r--r-- | sql/mysqld.cc | 10 | ||||
-rw-r--r-- | sql/wsrep_mysqld.cc | 30 |
3 files changed, 35 insertions, 32 deletions
diff --git a/sql/events.cc b/sql/events.cc index 999df79a4c0..fa40086c1f7 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1202,33 +1202,6 @@ int wsrep_create_event_query(THD *thd, uchar** buf, size_t* buf_len) } return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len); } -static int -wsrep_alter_query_string(THD *thd, String *buf) -{ - /* Append the "ALTER" part of the query */ - if (buf->append(STRING_WITH_LEN("ALTER "))) - return 1; - /* Append definer */ - append_definer(thd, buf, &(thd->lex->definer->user), &(thd->lex->definer->host)); - /* Append the left part of thd->query after event name part */ - if (buf->append(thd->lex->stmt_definition_begin, - thd->lex->stmt_definition_end - - thd->lex->stmt_definition_begin)) - return 1; - - return 0; -} -int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len) -{ - String log_query; - - if (wsrep_alter_query_string(thd, &log_query)) - { - WSREP_WARN("events alter string failed: %s", thd->query()); - return 1; - } - return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len); -} #endif /* WITH_WSREP */ /** @} (End of group Event_Scheduler) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7fe1adc346e..2c57c164446 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4841,12 +4841,12 @@ static int init_server_components() unireg_abort(1); /* need to configure logging before initializing storage engines */ - if (!opt_bin_log_used) + if (!opt_bin_log_used && !WSREP_ON) { - if (!WSREP_ON && opt_log_slave_updates) + if (opt_log_slave_updates) sql_print_warning("You need to use --log-bin to make " "--log-slave-updates work."); - if (!WSREP_ON && binlog_format_used) + if (binlog_format_used) sql_print_warning("You need to use --log-bin to make " "--binlog-format work."); } @@ -9214,8 +9214,8 @@ static int get_options(int *argc_ptr, char ***argv_ptr) (Yes, this is a hack, but it's required as the definition of max_relay_log_size allows it to be set to 0). */ - max_relay_log_size_var= intern_find_sys_var("max_relay_log_size", 0); - max_binlog_size_var= intern_find_sys_var("max_binlog_size", 0); + max_relay_log_size_var= intern_find_sys_var(STRING_WITH_LEN("max_relay_log_size")); + max_binlog_size_var= intern_find_sys_var(STRING_WITH_LEN("max_binlog_size")); if (max_binlog_size_var && max_relay_log_size_var) { max_relay_log_size_var->option.min_value= diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 0dd273a0df7..8dc9c776def 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -22,6 +22,7 @@ #include "rpl_filter.h" #include "sql_callback.h" #include "sp_head.h" +#include "sql_show.h" #include "sp.h" #include "wsrep_priv.h" #include "wsrep_thd.h" @@ -1271,6 +1272,35 @@ int wsrep_to_buf_helper( return ret; } +static int +wsrep_alter_query_string(THD *thd, String *buf) +{ + /* Append the "ALTER" part of the query */ + if (buf->append(STRING_WITH_LEN("ALTER "))) + return 1; + /* Append definer */ + append_definer(thd, buf, &(thd->lex->definer->user), &(thd->lex->definer->host)); + /* Append the left part of thd->query after event name part */ + if (buf->append(thd->lex->stmt_definition_begin, + thd->lex->stmt_definition_end - + thd->lex->stmt_definition_begin)) + return 1; + + return 0; +} + +int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len) +{ + String log_query; + + if (wsrep_alter_query_string(thd, &log_query)) + { + WSREP_WARN("events alter string failed: %s", thd->query()); + return 1; + } + return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len); +} + #include "sql_show.h" static int create_view_query(THD *thd, uchar** buf, size_t* buf_len) |