From: Date: October 1 2007 5:23pm Subject: bk commit into 5.0 tree (gshchepa:1.2535) BUG#31077 List-Archive: http://lists.mysql.com/commits/34720 X-Bug: 31077 Message-Id: <20071001152340.D9F743D4195@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of uchum. When uchum does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-10-01 20:23:35+05:00, gshchepa@stripped +4 -0 Fixed bug #31077. mysqldump adds the "-- Dump completed on YYYY-MM-DD hh:mm:ss" string to the end of output if the --comments switch is on. The only way to suppress this line is to use --skip-comments/--compact switch. Two new switches have been added to the mysqldump client command line: --dump-date and --skip-dump-date. For the compatibility with previous releases, by default the --dump-date is on and the --skip-dump-date is off. The --skip-dump-date option suppresses appending of the "Dump completed" string to the output. The --dump-date option forces output of the "Dump completed" string. --skip-comments or --compact switches disable that output as usual. client/client_priv.h@stripped, 2007-10-01 20:18:00+05:00, gshchepa@stripped +1 -1 Fixed bug #31077. New OPT_DUMP_DATE option has been added to implement the mysqldump client --dump-date switch. client/mysqldump.c@stripped, 2007-10-01 20:18:04+05:00, gshchepa@stripped +13 -5 Fixed bug #31077. The opt_dump_date variable has been added to imlements the mysqldump cliemt --dump-date switch. By default this switch is on (for compatibility with previous releases). The --dump-date switch forces mysqldump to add date to the "-- Dump completed on ..." string at the end of output. The --skip-dump-date switch supresses the output of date string and uses short form of that commentary: "-- Dump completed". --skip-comments or --compact switches disable the whole commentary as usual. mysql-test/r/mysqldump.result@stripped, 2007-10-01 20:23:13+05:00, gshchepa@stripped +10 -0 Added test case for bug #31077. mysql-test/t/mysqldump.test@stripped, 2007-10-01 20:23:10+05:00, gshchepa@stripped +14 -0 Added test case for bug #31077. diff -Nrup a/client/client_priv.h b/client/client_priv.h --- a/client/client_priv.h 2007-03-23 22:24:01 +04:00 +++ b/client/client_priv.h 2007-10-01 20:18:00 +05:00 @@ -51,5 +51,5 @@ enum options_client OPT_TRIGGERS, OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE, OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT, - OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE + OPT_DEBUG_INFO, OPT_ERROR_LOG_FILE, OPT_DUMP_DATE }; diff -Nrup a/client/mysqldump.c b/client/mysqldump.c --- a/client/mysqldump.c 2007-08-31 16:53:54 +05:00 +++ b/client/mysqldump.c 2007-10-01 20:18:04 +05:00 @@ -89,7 +89,7 @@ static my_bool verbose= 0, opt_no_creat opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0, opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0, - opt_set_charset=0, + opt_set_charset=0, opt_dump_date=1, opt_autocommit=0,opt_disable_keys=1,opt_xml=0, opt_delete_master_logs=0, tty_password=0, opt_single_transaction=0, opt_comments= 0, opt_compact= 0, @@ -402,6 +402,9 @@ static struct my_option my_long_options[ "automatically turns off --lock-tables.", (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.", + (gptr*) &opt_dump_date, (gptr*) &opt_dump_date, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"skip-opt", OPT_SKIP_OPTIMIZATION, "Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -623,10 +626,15 @@ static void write_footer(FILE *sql_file) fputs("\n", sql_file); if (opt_comments) { - char time_str[20]; - get_date(time_str, GETDATE_DATE_TIME, 0); - fprintf(sql_file, "-- Dump completed on %s\n", - time_str); + if (opt_dump_date) + { + char time_str[20]; + get_date(time_str, GETDATE_DATE_TIME, 0); + fprintf(sql_file, "-- Dump completed on %s\n", + time_str); + } + else + fprintf(sql_file, "-- Dump completed"); } check_io(sql_file); } diff -Nrup a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result --- a/mysql-test/r/mysqldump.result 2007-07-31 21:00:52 +05:00 +++ b/mysql-test/r/mysqldump.result 2007-10-01 20:23:13 +05:00 @@ -3544,5 +3544,15 @@ c1 2 DROP TABLE t1,t2; # +# Bug#29815: new option for suppressing last line of mysqldump: +# "Dump completed on" +# +# --skip-dump-date: +-- Dump completed +# --dump-date: +-- Dump completed on -- :: +# --dump-date (default): +-- Dump completed on -- :: +# # End of 5.0 tests # diff -Nrup a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test --- a/mysql-test/t/mysqldump.test 2007-07-21 04:49:17 +05:00 +++ b/mysql-test/t/mysqldump.test 2007-10-01 20:23:10 +05:00 @@ -1577,5 +1577,19 @@ SELECT * FROM t2; DROP TABLE t1,t2; --echo # +--echo # Bug#29815: new option for suppressing last line of mysqldump: +--echo # "Dump completed on" +--echo # + +--echo # --skip-dump-date: +--exec $MYSQL_DUMP --skip-dump-date test | grep 'Dump completed' + +--echo # --dump-date: +--exec $MYSQL_DUMP --dump-date test | grep 'Dump completed' | tr -d '[0-9]' + +--echo # --dump-date (default): +--exec $MYSQL_DUMP test | grep 'Dump completed' | tr -d '[0-9]' + +--echo # --echo # End of 5.0 tests --echo #