summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2008-12-13 19:42:12 +0000
committerAlfranio Correia <alfranio.correia@sun.com>2008-12-13 19:42:12 +0000
commit19f859a27e60270f3cdc7e2edc34e88c29536c21 (patch)
tree3ca8c469534126c025304d8d96dbeb2b359a6c00 /sql/sql_repl.cc
parent5c16a315ca28c18949e27b91cddf0886329d1dd4 (diff)
parentba816c14a9bc8012759da9d58f858f1e73bec708 (diff)
downloadmariadb-git-19f859a27e60270f3cdc7e2edc34e88c29536c21.tar.gz
merge 5.1 --> 5.1-rpl
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc74
1 files changed, 23 insertions, 51 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 7aa54d3208f..3ab211f5db6 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1660,64 +1660,38 @@ public:
static sys_var_chain vars = { NULL, NULL };
+static sys_var_const sys_log_slave_updates(&vars, "log_slave_updates",
+ OPT_GLOBAL, SHOW_MY_BOOL,
+ (uchar*) &opt_log_slave_updates);
+static sys_var_const sys_relay_log(&vars, "relay_log",
+ OPT_GLOBAL, SHOW_CHAR_PTR,
+ (uchar*) &opt_relay_logname);
+static sys_var_const sys_relay_log_index(&vars, "relay_log_index",
+ OPT_GLOBAL, SHOW_CHAR_PTR,
+ (uchar*) &opt_relaylog_index_name);
+static sys_var_const sys_relay_log_info_file(&vars, "relay_log_info_file",
+ OPT_GLOBAL, SHOW_CHAR_PTR,
+ (uchar*) &relay_log_info_file);
static sys_var_bool_ptr sys_relay_log_purge(&vars, "relay_log_purge",
&relay_log_purge);
+static sys_var_const sys_relay_log_space_limit(&vars,
+ "relay_log_space_limit",
+ OPT_GLOBAL, SHOW_LONGLONG,
+ (uchar*)
+ &relay_log_space_limit);
+static sys_var_const sys_slave_load_tmpdir(&vars, "slave_load_tmpdir",
+ OPT_GLOBAL, SHOW_CHAR_PTR,
+ (uchar*) &slave_load_tmpdir);
static sys_var_long_ptr sys_slave_net_timeout(&vars, "slave_net_timeout",
&slave_net_timeout);
+static sys_var_const sys_slave_skip_errors(&vars, "slave_skip_errors",
+ OPT_GLOBAL, SHOW_CHAR,
+ (uchar*) slave_skip_error_names);
static sys_var_long_ptr sys_slave_trans_retries(&vars, "slave_transaction_retries",
&slave_trans_retries);
static sys_var_sync_binlog_period sys_sync_binlog_period(&vars, "sync_binlog", &sync_binlog_period);
static sys_var_slave_skip_counter sys_slave_skip_counter(&vars, "sql_slave_skip_counter");
-static int show_slave_skip_errors(THD *thd, SHOW_VAR *var, char *buff);
-
-
-static SHOW_VAR fixed_vars[]= {
- {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL},
- {"relay_log" , (char*) &opt_relay_logname, SHOW_CHAR_PTR},
- {"relay_log_index", (char*) &opt_relaylog_index_name, SHOW_CHAR_PTR},
- {"relay_log_info_file", (char*) &relay_log_info_file, SHOW_CHAR_PTR},
- {"relay_log_space_limit", (char*) &relay_log_space_limit, SHOW_LONGLONG},
- {"slave_load_tmpdir", (char*) &slave_load_tmpdir, SHOW_CHAR_PTR},
- {"slave_skip_errors", (char*) &show_slave_skip_errors, SHOW_FUNC},
-};
-
-static int show_slave_skip_errors(THD *thd, SHOW_VAR *var, char *buff)
-{
- var->type=SHOW_CHAR;
- var->value= buff;
- if (!use_slave_mask || bitmap_is_clear_all(&slave_error_mask))
- {
- var->value= const_cast<char *>("OFF");
- }
- else if (bitmap_is_set_all(&slave_error_mask))
- {
- var->value= const_cast<char *>("ALL");
- }
- else
- {
- /* 10 is enough assuming errors are max 4 digits */
- int i;
- var->value= buff;
- for (i= 1;
- i < MAX_SLAVE_ERROR &&
- (buff - var->value) < SHOW_VAR_FUNC_BUFF_SIZE;
- i++)
- {
- if (bitmap_is_set(&slave_error_mask, i))
- {
- buff= int10_to_str(i, buff, 10);
- *buff++= ',';
- }
- }
- if (var->value != buff)
- buff--; // Remove last ','
- if (i < MAX_SLAVE_ERROR)
- buff= strmov(buff, "..."); // Couldn't show all errors
- *buff=0;
- }
- return 0;
-}
bool sys_var_slave_skip_counter::check(THD *thd, set_var *var)
{
@@ -1765,8 +1739,6 @@ bool sys_var_sync_binlog_period::update(THD *thd, set_var *var)
int init_replication_sys_vars()
{
- mysql_append_static_vars(fixed_vars, sizeof(fixed_vars) / sizeof(SHOW_VAR));
-
if (mysql_add_sys_var_chain(vars.first, my_long_options))
{
/* should not happen */