summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-08-07 18:29:20 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-08-07 18:29:20 -0400
commitf8420992c0b604ec7b673fc8dc90312af2f800dc (patch)
tree843204783facd33ea6a593baa5681046e85b99e1 /client
parent746c755d423d02a41a8e22a80e84ed4eff260ba4 (diff)
downloadmariadb-git-f8420992c0b604ec7b673fc8dc90312af2f800dc.tar.gz
MDEV-6490: mysqldump unknown option --galera-sst-mode
* Merged patches pushed to 10.0. * Additional fix in wsrep_sst_mysqldump.sh to control use of RESET MASTER and mysqldump's galera-sst-mode option based on joiner's @@log-bin value.
Diffstat (limited to 'client')
-rw-r--r--client/client_priv.h2
-rw-r--r--client/mysqldump.c24
2 files changed, 9 insertions, 17 deletions
diff --git a/client/client_priv.h b/client/client_priv.h
index dddf934e509..ef93818829e 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -92,9 +92,7 @@ enum options_client
OPT_REPORT_PROGRESS,
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
OPT_SSL_CRL, OPT_SSL_CRLPATH,
-#ifdef WITH_WSREP
OPT_GALERA_SST_MODE,
-#endif
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 3485f9cbd47..eba5bd93671 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -111,9 +111,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
opt_slave_apply= 0,
opt_include_master_host_port= 0,
opt_events= 0, opt_comments_used= 0,
-#ifdef WITH_WSREP
opt_galera_sst_mode= 0,
-#endif
opt_alltspcs=0, opt_notspcs= 0;
static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
@@ -349,14 +347,14 @@ static struct my_option my_long_options[] =
{"force", 'f', "Continue even if we get an SQL error.",
&ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
-#ifdef WITH_WSREP
- {"galera-sst-mode", OPT_GALERA_SST_MODE, "This mode is normally used "
- "in mysqldump snapshot-state transfer in a Galera cluster. If enabled, "
- "mysqldump additionally emits statements to turn off binary logging and "
- "set global gtid_binlog_state with the current value.",
+ {"galera-sst-mode", OPT_GALERA_SST_MODE,
+ "This mode should normally be used in mysqldump snapshot state transfer "
+ "(SST) in a Galera cluster. If enabled, mysqldump additionally dumps "
+ "commands to turn off binary logging and SET global gtid_binlog_state "
+ "with the current value. Note: RESET MASTER needs to be executed on the "
+ "server receiving the resulting dump.",
&opt_galera_sst_mode, &opt_galera_sst_mode, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
-#endif
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
@@ -4810,13 +4808,12 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
} /* dump_selected_tables */
-#ifdef WITH_WSREP
/**
- Additionally emit the following statements :
+ Add the following statements to the generated dump:
a) SET @@session.sql_log_bin=OFF;
b) SET @@global.gtid_binlog_state='[N-N-N,...]'
*/
-static int wsrep_add_sst_mode_cmds(MYSQL *mysql) {
+static int wsrep_set_sst_cmds(MYSQL *mysql) {
MYSQL_RES *res;
MYSQL_ROW row;
@@ -4846,7 +4843,6 @@ static int wsrep_add_sst_mode_cmds(MYSQL *mysql) {
mysql_free_result(res);
return 0;
}
-#endif
static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos)
{
@@ -5793,10 +5789,8 @@ int main(int argc, char **argv)
if (opt_slave_apply && add_stop_slave())
goto err;
-#ifdef WITH_WSREP
- if (opt_galera_sst_mode && wsrep_add_sst_mode_cmds(mysql))
+ if (opt_galera_sst_mode && wsrep_set_sst_cmds(mysql))
goto err;
-#endif
if (opt_master_data && do_show_master_status(mysql, consistent_binlog_pos))
goto err;