From 4faef126ff99a7a514834758723734393abb6d93 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 May 2020 09:01:54 +0000 Subject: [PATCH] Improved structure --- src/Database/DBStructure.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 9f225cbb9..352e8b0f8 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -1074,21 +1074,18 @@ class DBStructure */ private static function isUpdating() { - $processes = DBA::select(['information_schema' => 'processlist'], - ['command', 'info'], ['db' => DBA::databaseName()]); - $isUpdate = false; + $processes = DBA::select(['information_schema' => 'processlist'], ['info'], + ['db' => DBA::databaseName(), 'command' => ['Query', 'Execute']]); + while ($process = DBA::fetch($processes)) { - if (empty($process['info'])) { - continue; - } $parts = explode(' ', $process['info']); - $command = strtolower(array_shift($parts)); - if ($command == 'alter') { + if (strtolower(array_shift($parts)) == 'alter') { $isUpdate = true; } } + DBA::close($processes); return $isUpdate;