From 9642af4ed5df69a939726e4b8f361bfc9e26f04f Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 31 Aug 2015 08:32:50 -0400 Subject: [PATCH] Fixes #11447 MySQL 5.5 and the language system variable Signed-off-by: Marc Delisle --- ChangeLog | 1 + libraries/DatabaseInterface.class.php | 55 ++++++++++++++------------- libraries/dbi/DBIDummy.class.php | 2 +- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce556ea72a..a1a3865daf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ phpMyAdmin - ChangeLog - issue #11421 Stored-proc / routine - broken parameter parsing - issue Missing name for configuration read_as_multibytes - issue #11431 Incorrect "No row selected" message +- issue #11447 MySQL 5.5 and the language system variable 4.4.14.0 (2015-08-20) - issue #11367 Export after search, missing WHERE clause diff --git a/libraries/DatabaseInterface.class.php b/libraries/DatabaseInterface.class.php index 6f1f7241b4..3913426054 100644 --- a/libraries/DatabaseInterface.class.php +++ b/libraries/DatabaseInterface.class.php @@ -228,42 +228,43 @@ class PMA_DatabaseInterface public function convertMessage($message) { // latin always last! + // @todo some values are missing, + // see https://mariadb.com/kb/en/mariadb/server-locale/ + $encodings = array( - 'japanese' => 'EUC-JP', //'ujis', - 'japanese-sjis' => 'Shift-JIS', //'sjis', - 'korean' => 'EUC-KR', //'euckr', - 'russian' => 'KOI8-R', //'koi8r', - 'ukrainian' => 'KOI8-U', //'koi8u', - 'greek' => 'ISO-8859-7', //'greek', - 'serbian' => 'CP1250', //'cp1250', - 'estonian' => 'ISO-8859-13', //'latin7', - 'slovak' => 'ISO-8859-2', //'latin2', - 'czech' => 'ISO-8859-2', //'latin2', - 'hungarian' => 'ISO-8859-2', //'latin2', - 'polish' => 'ISO-8859-2', //'latin2', - 'romanian' => 'ISO-8859-2', //'latin2', - 'spanish' => 'CP1252', //'latin1', - 'swedish' => 'CP1252', //'latin1', - 'italian' => 'CP1252', //'latin1', - 'norwegian-ny' => 'CP1252', //'latin1', - 'norwegian' => 'CP1252', //'latin1', - 'portuguese' => 'CP1252', //'latin1', - 'danish' => 'CP1252', //'latin1', - 'dutch' => 'CP1252', //'latin1', - 'english' => 'CP1252', //'latin1', - 'french' => 'CP1252', //'latin1', - 'german' => 'CP1252', //'latin1', + 'ja' => 'EUC-JP', //'ujis', + 'ko' => 'EUC-KR', //'euckr', + 'ru' => 'KOI8-R', //'koi8r', + 'uk' => 'KOI8-U', //'koi8u', + 'sr' => 'CP1250', //'cp1250', + 'et' => 'ISO-8859-13', //'latin7', + 'sk' => 'ISO-8859-2', //'latin2', + 'cz' => 'ISO-8859-2', //'latin2', + 'hu' => 'ISO-8859-2', //'latin2', + 'pl' => 'ISO-8859-2', //'latin2', + 'ro' => 'ISO-8859-2', //'latin2', + 'es' => 'CP1252', //'latin1', + 'sv' => 'CP1252', //'latin1', + 'it' => 'CP1252', //'latin1', + 'no' => 'CP1252', //'latin1', + 'pt' => 'CP1252', //'latin1', + 'da' => 'CP1252', //'latin1', + 'nl' => 'CP1252', //'latin1', + 'en' => 'CP1252', //'latin1', + 'fr' => 'CP1252', //'latin1', + 'de' => 'CP1252', //'latin1', ); $server_language = $this->fetchValue( - 'SHOW VARIABLES LIKE \'language\';', + 'SELECT @@lc_messages;', 0, - 1 + 0 ); + if ($server_language) { $found = array(); $match = preg_match( - '&(?:\\\|\\/)([^\\\\\/]*)(?:\\\|\\/)$&i', + '&([a-z][a-z])_&i', $server_language, $found ); diff --git a/libraries/dbi/DBIDummy.class.php b/libraries/dbi/DBIDummy.class.php index fef75e867c..07208bc3b8 100644 --- a/libraries/dbi/DBIDummy.class.php +++ b/libraries/dbi/DBIDummy.class.php @@ -122,7 +122,7 @@ $GLOBALS['dummy_queries'] = array( ) ), array( - 'query' => 'SHOW VARIABLES LIKE \'language\';', + 'query' => 'SELECT @@lc_messages;', 'result' => array(), ), array(