From 5720fb3843dc620c99c1dd29d473b02a5f6c180a Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 17 Jul 2013 07:08:35 -0400 Subject: [PATCH] Incorrect Drizzle 7 detection (backport from 37781045) --- ChangeLog | 1 + libraries/database_interface.lib.php | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2601e92fd7..9c76feceae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog - bug #3985 Call to undefined function mb_detect_encoding - bug #4007 Analyze option not shown for InnoDB tables - bug #4015 Forcing a storage engine for configuration storage +- bug Incorrect Drizzle 7 detection 4.0.4.1 (2013-06-30) - [security] Global variables scope injection vulnerability (see PMASA-2013-7) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index de697ec119..439f15cd42 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -1484,6 +1484,10 @@ function PMA_DBI_postConnect($link, $is_controluser = false) 'PMA_MYSQL_VERSION_COMMENT', PMA_Util::cacheGet('PMA_MYSQL_VERSION_COMMENT', true) ); + define( + 'PMA_DRIZZLE', + PMA_Util::cacheGet('PMA_DRIZZLE', true) + ); } else { $version = PMA_DBI_fetch_single_row( 'SELECT @@version, @@version_comment', @@ -1528,10 +1532,24 @@ function PMA_DBI_postConnect($link, $is_controluser = false) PMA_MYSQL_VERSION_COMMENT, true ); + // Detect Drizzle - it does not support character sets + $charset_result = PMA_DBI_get_variable( + 'character_set_results', + PMA_DBI_GETVAR_GLOBAL, + $link + ); + if ($charset_result) { + define('PMA_DRIZZLE', false); + } else { + define('PMA_DRIZZLE', true); + } + PMA_Util::cacheSet( + 'PMA_DRIZZLE', + PMA_DRIZZLE, + true + ); + } - // detect Drizzle by version number: - // ..(.= 2009); } // Skip charsets for Drizzle