summaryrefslogtreecommitdiff
path: root/client/client_priv.h
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2009-11-04 14:31:03 +0100
committerMagne Mahre <magne.mahre@sun.com>2009-11-04 14:31:03 +0100
commitc08343480d233f41efc2852f0afcb61dd9020346 (patch)
tree24e8a446c054c2517ff9e6ef997dcc9416d1572c /client/client_priv.h
parentb5d75433be645ff901cf3144b770c20988a5fc63 (diff)
downloadmariadb-git-c08343480d233f41efc2852f0afcb61dd9020346.tar.gz
BUG #8368 "mysqldump needs --slave-data option"
Added this option, named as "--dump-slave". The purpose of this option is to be able to produce a dump from a slave used for making backups of the master. Originally, dumping from the main master was fine, but as more data accumulated, the dump process would take over 30 minutes, locking up the master database hence website for 30 minutes. A slave dedicated to producing backups was the answer, but I needed a dump that could be used to restore a slave instantly and in order to do that, it has to have three things contained in the dump: 1. "STOP SLAVE;" at the beginning 2. "CHANGE MASTER TO ...<the master - info from 'show slave status'>" 3. "START SLAVE;" at the end These options in this changeset contain this. --stop-slave adds "STOP SLAVE" to the beginning of the dump and "STOP SLAVE" to the end of the dump. --include-host gives the user the option to have the host explicitely added to the "CHANGE MASTER TO ..." line. --dump-slave adds the "CHANGE MASTER ..." to the dump representing not the slave's master binlog info, but the slave's master's info from "SHOW SLAVE STATUS" client/client_priv.h: Added OPT_SLAVE_DATA to client_priv.h client/mysqldump.c: * Added --dump-slave option (name per Brian) * Added --stop-slave to print "STOP SLAVE;" into the dump * Added --include-host option to include "MASTER_HOST=..." and "MASTER_PORT=..." to the dump since unlike --master-data, the host can't be assumed to be the local host * Added do_start_slave and do_stop_slave to stop the slave sql thread upon start of the dump process, and to start the slave sql upon finish of dump process - to keep the log information frozen during this time. * Added do_show_slave_status for obtaining slave information needed to compose "CHANGE MASTER ..." output to the master of this slave. * Added necessary long options and defines required for new options
Diffstat (limited to 'client/client_priv.h')
-rw-r--r--client/client_priv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/client_priv.h b/client/client_priv.h
index c24e125e200..53027465771 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -62,6 +62,9 @@ enum options_client
OPT_MYSQL_NUMBER_OF_QUERY,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA,
+ OPT_MYSQLDUMP_SLAVE_APPLY,
+ OPT_MYSQLDUMP_SLAVE_DATA,
+ OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,
OPT_SLAP_CSV, OPT_SLAP_CREATE_STRING,
OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE, OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
OPT_SLAP_AUTO_GENERATE_ADD_AUTO,