diff options
author | gshchepa/uchum@gleb.loc <> | 2007-10-01 20:35:51 +0500 |
---|---|---|
committer | gshchepa/uchum@gleb.loc <> | 2007-10-01 20:35:51 +0500 |
commit | 5fc81ee88e37656f83dd0231a96b08f73b69523c (patch) | |
tree | e3433afc1e6dcbd3df970ddf9c2191e960c4421a /client/mysqldump.c | |
parent | 4cd18bde81fc0c2f4ccbe8cfdd52ee9f7c2e2e7c (diff) | |
download | mariadb-git-5fc81ee88e37656f83dd0231a96b08f73b69523c.tar.gz |
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.
New switch has been added to the mysqldump client command line:
--dump-date.
For the compatibility with previous releases, by default the --dump-date
is on.
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.
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index cc8458c7a8e..fb28647a120 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -89,7 +89,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, 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); } |