diff options
author | Nirbhay Choubey <nirbhay.choubey@oracle.com> | 2011-04-08 12:25:59 +0530 |
---|---|---|
committer | Nirbhay Choubey <nirbhay.choubey@oracle.com> | 2011-04-08 12:25:59 +0530 |
commit | 4cf9d978ec1ae9d53ec7facfafc9282ffdf9d53c (patch) | |
tree | e8777c1474b6451168c973a57d80aedb8f09ced7 /client/mysqlslap.c | |
parent | 35de758649d081ceacbeffe7f379264bc6136075 (diff) | |
parent | b563350e7a7918e3899039e51ba57d639b412e10 (diff) | |
download | mariadb-git-4cf9d978ec1ae9d53ec7facfafc9282ffdf9d53c.tar.gz |
Merging patch for bug#11765157 from mysql-5.1.
Diffstat (limited to 'client/mysqlslap.c')
-rw-r--r-- | client/mysqlslap.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 237fa18c226..88e80c0c7f8 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -128,7 +128,7 @@ const char *delimiter= "\n"; const char *create_schema_string= "mysqlslap"; -static my_bool opt_preserve= TRUE; +static my_bool opt_preserve= TRUE, opt_no_drop= FALSE; static my_bool debug_info_flag= 0, debug_check_flag= 0; static my_bool opt_only_print= FALSE; static my_bool opt_compress= FALSE, tty_password= FALSE, @@ -607,6 +607,8 @@ static struct my_option my_long_options[] = REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"iterations", 'i', "Number of times to run the tests.", &iterations, &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, + {"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.", + &opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"number-char-cols", 'x', "Number of VARCHAR columns to create in table if specifying --auto-generate-sql.", &num_char_cols_opt, &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG, @@ -1149,8 +1151,11 @@ get_options(int *argc,char ***argv) if (!user) user= (char *)"root"; - /* If something is created we clean it up, otherwise we leave schemas alone */ - if (create_string || auto_generate_sql) + /* + If something is created and --no-drop is not specified, we drop the + schema. + */ + if (!opt_no_drop && (create_string || auto_generate_sql)) opt_preserve= FALSE; if (auto_generate_sql && (create_string || user_supplied_query)) |