diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/client_priv.h | 3 | ||||
-rw-r--r-- | client/mysqldump.c | 18 | ||||
-rw-r--r-- | client/mysqlslap.c | 18 |
3 files changed, 26 insertions, 13 deletions
diff --git a/client/client_priv.h b/client/client_priv.h index a2f61b9e9ca..c205d07c34c 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -80,5 +80,6 @@ enum options_client OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT, OPT_SERVER_ID, OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT, OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE, - OPT_WRITE_BINLOG, OPT_MAX_CLIENT_OPTION + OPT_WRITE_BINLOG, OPT_DUMP_DATE, + OPT_MAX_CLIENT_OPTION }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 9a83b609d0e..d504d177490 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -90,7 +90,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, @@ -424,6 +424,9 @@ static struct my_option my_long_options[] = "automatically turns off --lock-tables.", (uchar**) &opt_single_transaction, (uchar**) &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.", + (uchar**) &opt_dump_date, (uchar**) &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}, @@ -651,10 +654,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\n"); } check_io(sql_file); } diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 02a0cbd04c5..1c54ba86718 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -140,7 +140,8 @@ static my_bool opt_compress= FALSE, tty_password= FALSE, auto_generate_sql= FALSE; const char *auto_generate_sql_type= "mixed"; -static unsigned long connect_flags= CLIENT_MULTI_RESULTS; +static unsigned long connect_flags= CLIENT_MULTI_RESULTS | + CLIENT_MULTI_STATEMENTS; static int verbose, delimiter_length; static uint commit_rate; @@ -1877,13 +1878,16 @@ limit_not_met: } } - if (mysql_field_count(mysql)) + do { - result= mysql_store_result(mysql); - while ((row = mysql_fetch_row(result))) - counter++; - mysql_free_result(result); - } + if (mysql_field_count(mysql)) + { + result= mysql_store_result(mysql); + while ((row = mysql_fetch_row(result))) + counter++; + mysql_free_result(result); + } + } while(mysql_next_result(mysql) == 0); queries++; if (commit_rate && commit_rate <= trans_counter) |