diff options
author | unknown <guilhem@mysql.com> | 2004-11-16 00:04:12 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-11-16 00:04:12 +0100 |
commit | 445c9103a345c560d15beec8c7ad4c944c3b1d2c (patch) | |
tree | 4b3acfdee8480e9e03666d068ee6a08eed12672b /client/mysqldump.c | |
parent | 6763a1da76a07c3962492acae491c341714f8b82 (diff) | |
parent | fa68d58087f0439fe9289ea3da830017a2ce5769 (diff) | |
download | mariadb-git-445c9103a345c560d15beec8c7ad4c944c3b1d2c.tar.gz |
Merge
Makefile.am:
Auto merged
client/Makefile.am:
Auto merged
client/mysqldump.c:
Auto merged
configure.in:
Auto merged
include/my_global.h:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
sql/sql_parse.cc:
SCCS merged
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index f9cbc8f8789..45b265569bb 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -256,7 +256,7 @@ static struct my_option my_long_options[] = "any action on logs will happen at the exact moment of the dump." "Option automatically turns --lock-tables off.", (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0, - GET_UINT, REQUIRED_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, + GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, @@ -552,6 +552,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case '?': usage(); exit(0); + case (int) OPT_MASTER_DATA: + if (!argument) /* work like in old versions */ + opt_master_data= MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL; + break; case (int) OPT_OPTIMIZE: extended_insert= opt_drop= opt_lock= quick= create_options= opt_disable_keys= lock_tables= opt_set_charset= 1; @@ -2149,8 +2153,18 @@ static int do_show_master_status(MYSQL *mysql_con) static int do_flush_tables_read_lock(MYSQL *mysql_con) { + /* + We do first a FLUSH TABLES. If a long update is running, the FLUSH TABLES + will wait but will not stall the whole mysqld, and when the long update is + done the FLUSH TABLES WITH READ LOCK will start and succeed quickly. So, + FLUSH TABLES is to lower the probability of a stage where both mysqldump + and most client connections are stalled. Of course, if a second long + update starts between the two FLUSHes, we have that bad stall. + */ return - mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES WITH READ LOCK"); + ( mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES") || + mysql_query_with_error_report(mysql_con, 0, + "FLUSH TABLES WITH READ LOCK") ); } |