Commit 425dc6d2 authored by Sergei Golubchik's avatar Sergei Golubchik

small cleanup

parent 7aabc2de
......@@ -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)
......
......@@ -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=
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment