Commit 013595f5 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-13332 mariabackup from 10.2.x crashes with --ftwrl-* options

Fixed null pointer dereference in parsing "show full processlist" output
with atoi().

Some  Innodb background thread has NULL in 'Time' column,
thus  backup would crash with when atoi is applied to null pointer.
parent 1b3cf18e
...@@ -724,7 +724,7 @@ have_queries_to_wait_for(MYSQL *connection, uint threshold) ...@@ -724,7 +724,7 @@ have_queries_to_wait_for(MYSQL *connection, uint threshold)
all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL); all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) { while ((row = mysql_fetch_row(result)) != NULL) {
const char *info = row[7]; const char *info = row[7];
int duration = atoi(row[5]); int duration = row[5] ? atoi(row[5]) : 0;
char *id = row[0]; char *id = row[0];
if (info != NULL if (info != NULL
...@@ -754,7 +754,7 @@ kill_long_queries(MYSQL *connection, time_t timeout) ...@@ -754,7 +754,7 @@ kill_long_queries(MYSQL *connection, time_t timeout)
all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL); all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) { while ((row = mysql_fetch_row(result)) != NULL) {
const char *info = row[7]; const char *info = row[7];
long long duration = atoll(row[5]); long long duration = row[5]? atoll(row[5]) : 0;
char *id = row[0]; char *id = row[0];
if (info != NULL && if (info != NULL &&
......
...@@ -14,7 +14,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir ...@@ -14,7 +14,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir
--enable_result_log --enable_result_log
INSERT INTO t VALUES(2); INSERT INTO t VALUES(2);
SELECT * FROM t; SELECT * FROM t;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir;
--disable_result_log --disable_result_log
echo # Prepare full backup, apply incremental one; echo # Prepare full backup, apply incremental one;
......
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