diff options
Diffstat (limited to 'client/mysqlslap.c')
-rw-r--r-- | client/mysqlslap.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c index f0ad2f40abc..83c5838f739 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -144,7 +144,7 @@ static unsigned long connect_flags= CLIENT_MULTI_RESULTS | CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS; -static int verbose, delimiter_length; +static int verbose; static uint commit_rate; static uint detach_rate; const char *num_int_cols_opt; @@ -263,7 +263,7 @@ void option_cleanup(option_string *stmt); void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr); static int run_statements(MYSQL *mysql, statement *stmt); int slap_connect(MYSQL *mysql); -static int run_query(MYSQL *mysql, const char *query, int len); +static int run_query(MYSQL *mysql, const char *query, size_t len); static const char ALPHANUMERICS[]= "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz"; @@ -343,9 +343,6 @@ int main(int argc, char **argv) if (auto_generate_sql) srandom((uint)time(NULL)); - /* globals? Yes, so we only have to run strlen once */ - delimiter_length= strlen(delimiter); - if (argc > 2) { fprintf(stderr,"%s: Too many arguments\n",my_progname); @@ -1552,18 +1549,18 @@ get_options(int *argc,char ***argv) } -static int run_query(MYSQL *mysql, const char *query, int len) +static int run_query(MYSQL *mysql, const char *query, size_t len) { if (opt_only_print) { - printf("%.*s;\n", len, query); + printf("%.*s;\n", (int)len, query); return 0; } if (verbose >= 3) - printf("%.*s;\n", len, query); + printf("%.*s;\n", (int)len, query); - return mysql_real_query(mysql, query, len); + return mysql_real_query(mysql, query, (ulong)len); } @@ -2131,7 +2128,7 @@ parse_delimiter(const char *script, statement **stmt, char delm) char *ptr= (char *)script; statement **sptr= stmt; statement *tmp; - uint length= strlen(script); + size_t length= strlen(script); uint count= 0; /* We know that there is always one */ for (tmp= *sptr= (statement *)my_malloc(sizeof(statement), |