From 87daa014d36a75e27838f37acaf4990ad2f4c9fd Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Mon, 23 May 2022 12:49:54 +0200 Subject: [PATCH] bugfix ajax kill of running query (id check untested) --- phpwf/plugins/class.mysql.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/phpwf/plugins/class.mysql.php b/phpwf/plugins/class.mysql.php index 24392ca6..8cbeb1e5 100644 --- a/phpwf/plugins/class.mysql.php +++ b/phpwf/plugins/class.mysql.php @@ -1495,7 +1495,16 @@ class DB{ if($pid <= 0) { return false; } - return mysqli_query($this->connection, 'KILL QUERY '.$pid); + + // Get list of processes + $list_of_processes = mysqli_query($this->connection, "select id from information_schema.processlist where id=$pid"); + if (get_class($list_of_processes) == 'mysqli') { + if (mysqli_num_rows($list_of_processes) > 0) { + $result = mysqli_query($this->connection, 'KILL QUERY '.$pid); + return($result); + } + } + return(false); } /**