1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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

have_queries_to_wait_for(), kill_long_queries(): Declare and initialize
variables in one go.
This commit is contained in:
Marko Mäkelä
2017-08-18 10:00:56 +03:00
parent e9e051d297
commit 74ce0cf148

View File

@@ -715,14 +715,11 @@ static
bool
have_queries_to_wait_for(MYSQL *connection, uint threshold)
{
MYSQL_RES *result;
MYSQL_ROW row;
bool all_queries;
MYSQL_RES *result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST",
true);
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 ((row = mysql_fetch_row(result)) != NULL) {
while (MYSQL_ROW row = mysql_fetch_row(result)) {
const char *info = row[7];
int duration = row[5] ? atoi(row[5]) : 0;
char *id = row[0];
@@ -744,15 +741,12 @@ static
void
kill_long_queries(MYSQL *connection, time_t timeout)
{
MYSQL_RES *result;
MYSQL_ROW row;
bool all_queries;
char kill_stmt[100];
result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST", true);
all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) {
MYSQL_RES *result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST",
true);
const bool all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while (MYSQL_ROW row = mysql_fetch_row(result)) {
const char *info = row[7];
long long duration = row[5]? atoll(row[5]) : 0;
char *id = row[0];