diff options
author | unknown <sanja@askmonty.org> | 2013-09-25 21:07:06 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-09-25 21:07:06 +0300 |
commit | 9d83468e78ba23f024ce3c11443913ad75cf1ea5 (patch) | |
tree | 0cef7fa6a3fd2e47fe22d105b2b8bbfe1b5a03e0 /client | |
parent | 2fe0836eed16ce5809c34064893681f12c77da9f (diff) | |
parent | 64d6d8334fa63a0faa6d91ded21eca8e3871c7ec (diff) | |
download | mariadb-git-9d83468e78ba23f024ce3c11443913ad75cf1ea5.tar.gz |
merge 5.5 -> 10.0-base
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqlslap.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 8e70a2609c3..202fcf7950f 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -123,7 +123,8 @@ static char *host= NULL, *opt_password= NULL, *user= NULL, *default_engine= NULL, *pre_system= NULL, *post_system= NULL, - *opt_mysql_unix_port= NULL; + *opt_mysql_unix_port= NULL, + *opt_init_command= NULL; static char *opt_plugin_dir= 0, *opt_default_auth= 0; const char *delimiter= "\n"; @@ -629,6 +630,11 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"init-command", OPT_INIT_COMMAND, + "SQL Command to execute when connecting to MySQL server. Will " + "automatically be re-executed when reconnecting.", + &opt_init_command, &opt_init_command, 0, + GET_STR, 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.", @@ -2241,6 +2247,8 @@ slap_connect(MYSQL *mysql) for (x= 0; x < 10; x++) { set_mysql_connect_options(mysql); + if (opt_init_command) + mysql_options(mysql, MYSQL_INIT_COMMAND, opt_init_command); if (mysql_real_connect(mysql, host, user, opt_password, create_schema_string, opt_mysql_port, |