summaryrefslogtreecommitdiff
path: root/client/mysqlslap.c
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-01 14:42:02 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-01 14:42:02 +0300
commitf09687094cbfbfd2b4373ba6a09fc40a1644bd85 (patch)
tree54426145657611ff0acb10ea0beb02d6eb467e89 /client/mysqlslap.c
parenta1267724cb1d1837026a3a5f49e55931038e43e7 (diff)
parent392ee571c175e160869a2ee0510f818e81510a03 (diff)
downloadmariadb-git-f09687094cbfbfd2b4373ba6a09fc40a1644bd85.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'client/mysqlslap.c')
-rw-r--r--client/mysqlslap.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 1109ffbf3c8..757ebae415f 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
- Copyright (c) 2010, 2017, MariaDB
+ Copyright (c) 2010, 2022, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1835,12 +1835,11 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
pthread_handler_t run_task(void *p)
{
- ulonglong counter= 0, queries;
+ ulonglong queries;
ulonglong detach_counter;
unsigned int commit_counter;
MYSQL *mysql;
MYSQL_RES *result;
- MYSQL_ROW row;
statement *ptr;
thread_context *con= (thread_context *)p;
@@ -1961,8 +1960,7 @@ limit_not_met:
my_progname, mysql_errno(mysql), mysql_error(mysql));
else
{
- while ((row= mysql_fetch_row(result)))
- counter++;
+ while (mysql_fetch_row(result)) {}
mysql_free_result(result);
}
}
@@ -1972,7 +1970,7 @@ limit_not_met:
if (commit_rate && (++commit_counter == commit_rate))
{
commit_counter= 0;
- run_query(mysql, "COMMIT", strlen("COMMIT"));
+ run_query(mysql, C_STRING_WITH_LEN("COMMIT"));
}
if (con->limit && queries == con->limit)
@@ -1984,7 +1982,7 @@ limit_not_met:
end:
if (commit_rate)
- run_query(mysql, "COMMIT", strlen("COMMIT"));
+ run_query(mysql, C_STRING_WITH_LEN("COMMIT"));
mysql_close(mysql);