Commit 74ce0cf1 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-13574 related Mariabackup code cleanup (non-functional change)

have_queries_to_wait_for(), kill_long_queries(): Declare and initialize
variables in one go.
parent e9e051d2
...@@ -715,14 +715,11 @@ static ...@@ -715,14 +715,11 @@ static
bool bool
have_queries_to_wait_for(MYSQL *connection, uint threshold) have_queries_to_wait_for(MYSQL *connection, uint threshold)
{ {
MYSQL_RES *result; MYSQL_RES *result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST",
MYSQL_ROW row; true);
bool all_queries; const bool all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL);
result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST", true);
all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL); while (MYSQL_ROW row = mysql_fetch_row(result)) {
while ((row = mysql_fetch_row(result)) != NULL) {
const char *info = row[7]; const char *info = row[7];
int duration = row[5] ? atoi(row[5]) : 0; int duration = row[5] ? atoi(row[5]) : 0;
char *id = row[0]; char *id = row[0];
...@@ -744,15 +741,12 @@ static ...@@ -744,15 +741,12 @@ static
void void
kill_long_queries(MYSQL *connection, time_t timeout) kill_long_queries(MYSQL *connection, time_t timeout)
{ {
MYSQL_RES *result;
MYSQL_ROW row;
bool all_queries;
char kill_stmt[100]; char kill_stmt[100];
result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST", true); MYSQL_RES *result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST",
true);
all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL); const bool all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) { while (MYSQL_ROW row = mysql_fetch_row(result)) {
const char *info = row[7]; const char *info = row[7];
long long duration = row[5]? atoll(row[5]) : 0; long long duration = row[5]? atoll(row[5]) : 0;
char *id = row[0]; char *id = row[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment