From 04af09a999ae20f6123e910398ad1d7861b75b4d Mon Sep 17 00:00:00 2001 From: Till Brehm Date: Fri, 22 Sep 2017 14:11:27 +0200 Subject: [PATCH] Fixed a problem that caused the creation of mysql users to fail. This affected the dev branch only and not the stable 3.1.6 release. --- server/plugins-available/mysql_clientdb_plugin.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/plugins-available/mysql_clientdb_plugin.inc.php b/server/plugins-available/mysql_clientdb_plugin.inc.php index 58215389d..35ade14c4 100644 --- a/server/plugins-available/mysql_clientdb_plugin.inc.php +++ b/server/plugins-available/mysql_clientdb_plugin.inc.php @@ -78,13 +78,16 @@ class mysql_clientdb_plugin { $unwanted_sql_plugins = array('validate_password'); // strict-password-validation $temp = "'".implode("','", $unwanted_sql_plugins)."'"; $result = $link->query("SELECT plugin_name FROM information_schema.plugins WHERE plugin_status='ACTIVE' AND plugin_name IN ($temp)"); - if($result) { + if($result && $result->num_rows > 0) { + $sql_plugins = array(); while ($row = $result->fetch_assoc()) { $sql_plugins[] = $row['plugin_name']; } $result->free(); - foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin enabled - can not execute function process_host_list", LOGLEVEL_ERROR); - return false; + if(count($sql_plugins) > 0) { + foreach ($sql_plugins as $plugin) $app->log("MySQL-Plugin $plugin enabled - can not execute function process_host_list", LOGLEVEL_ERROR); + return false; + } } if(!$user_access_mode) $user_access_mode = 'rw'; -- GitLab