From 2242a24094a9ee2d1ef37cbd9cb7c5d7f44e847f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadas=20Ustinavi=C4=8Dius?= Date: Thu, 12 Oct 2017 18:19:29 +0300 Subject: [PATCH] Fix for password change issues on Galera cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tadas Ustinavičius --- libraries/server_privileges.lib.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php index 02bc0dab63c3..b1581d017ed7 100644 --- a/libraries/server_privileges.lib.php +++ b/libraries/server_privileges.lib.php @@ -1905,7 +1905,19 @@ function PMA_updatePassword($err_url, $username, $hostname) $local_query = $query_prefix . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . "'"; - } else if ($serverType == 'MariaDB' + } // MariaDB uses "SET PASSWORD" syntax to change user password. + // On Galera cluster only DDL queries are replicated, since + // users are stored in MyISAM storage engine. + else if ($serverType == 'MariaDB' + && PMA_MYSQL_INT_VERSION >= 10000 + ) { + $query_prefix = "SET PASSWORD FOR '" + . $GLOBALS['dbi']->escapeString($username) + . "'@'" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " = PASSWORD ('"; + $local_query = $query_prefix + . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . "')"; + } else if ($serverType == 'MariaDB' && PMA_MYSQL_INT_VERSION >= 50200 && $is_superuser ) {