The branch, master has been updated via 8b7180e05a0e261aaa2e84ac002ef25c7a6624ea (commit) via 88e6ca46094128f53ec922dc14d7b63d3ee6e910 (commit) via ae7a20607da1fc364106e39408283693c15f5957 (commit) via 2c7161c7a35f0d540e859dfb2903afeb7ced139a (commit) from cfe630dd4e329773e57f9740f642b804bccd101a (commit)
- Log ----------------------------------------------------------------- commit 8b7180e05a0e261aaa2e84ac002ef25c7a6624ea Merge: cfe630dd4e329773e57f9740f642b804bccd101a 88e6ca46094128f53ec922dc14d7b63d3ee6e910 Author: Michal Čihař michal@cihar.com Date: Thu Oct 21 10:05:41 2010 +0200
Merge remote branch 'mort-dev/master'
commit 88e6ca46094128f53ec922dc14d7b63d3ee6e910 Author: Michal Čihař michal@cihar.com Date: Thu Oct 21 10:04:49 2010 +0200
Avoid charset queries on Drizzle.
commit ae7a20607da1fc364106e39408283693c15f5957 Author: Michal Čihař michal@cihar.com Date: Thu Oct 21 10:04:37 2010 +0200
Do not set charset for Drizzle.
commit 2c7161c7a35f0d540e859dfb2903afeb7ced139a Author: Michal Čihař michal@cihar.com Date: Thu Oct 21 10:04:15 2010 +0200
Remember also MySQL major version.
-----------------------------------------------------------------------
Summary of changes: libraries/database_interface.lib.php | 19 +++++++++++++------ libraries/mysql_charsets.lib.php | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index c1a97b4..d5754a4 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -955,12 +955,14 @@ function PMA_DBI_postConnect($link, $is_controluser = false) if (! defined('PMA_MYSQL_INT_VERSION')) { if (PMA_cacheExists('PMA_MYSQL_INT_VERSION', true)) { define('PMA_MYSQL_INT_VERSION', PMA_cacheGet('PMA_MYSQL_INT_VERSION', true)); + define('PMA_MYSQL_MAJOR_VERSION', PMA_cacheGet('PMA_MYSQL_MAJOR_VERSION', true)); define('PMA_MYSQL_STR_VERSION', PMA_cacheGet('PMA_MYSQL_STR_VERSION', true)); } else { $mysql_version = PMA_DBI_fetch_value( 'SELECT VERSION()', 0, 0, $link, PMA_DBI_QUERY_STORE); if ($mysql_version) { $match = explode('.', $mysql_version); + define('PMA_MYSQL_MAJOR_VERSION', (int)$match[0]); define('PMA_MYSQL_INT_VERSION', (int) sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2]))); @@ -968,19 +970,24 @@ function PMA_DBI_postConnect($link, $is_controluser = false) unset($mysql_version, $match); } else { define('PMA_MYSQL_INT_VERSION', 50015); + define('PMA_MYSQL_MAJOR_VERSION', 5); define('PMA_MYSQL_STR_VERSION', '5.00.15'); } PMA_cacheSet('PMA_MYSQL_INT_VERSION', PMA_MYSQL_INT_VERSION, true); + PMA_cacheSet('PMA_MYSQL_MAJOR_VERSION', PMA_MYSQL_MAJOR_VERSION, true); PMA_cacheSet('PMA_MYSQL_STR_VERSION', PMA_MYSQL_STR_VERSION, true); } }
- if (! empty($GLOBALS['collation_connection'])) { - PMA_DBI_query("SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE); - $mysql_charset = explode('_', $GLOBALS['collation_connection']); - PMA_DBI_query("SET collation_connection = '" . PMA_sqlAddslashes($GLOBALS['collation_connection']) . "';", $link, PMA_DBI_QUERY_STORE); - } else { - PMA_DBI_query("SET NAMES 'utf8' COLLATE 'utf8_general_ci';", $link, PMA_DBI_QUERY_STORE); + /* Skip charsets for Drizzle */ + if (PMA_MYSQL_MAJOR_VERSION < 2009) { + if (! empty($GLOBALS['collation_connection'])) { + PMA_DBI_query("SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE); + $mysql_charset = explode('_', $GLOBALS['collation_connection']); + PMA_DBI_query("SET collation_connection = '" . PMA_sqlAddslashes($GLOBALS['collation_connection']) . "';", $link, PMA_DBI_QUERY_STORE); + } else { + PMA_DBI_query("SET NAMES 'utf8' COLLATE 'utf8_general_ci';", $link, PMA_DBI_QUERY_STORE); + } } }
diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index 51102f8..2463f1f 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -11,8 +11,18 @@ if (! defined('PHPMYADMIN')) { /** * */ - -if (! PMA_cacheExists('mysql_charsets_count', true)) { +if (PMA_MYSQL_MAJOR_VERSION > 2009) { + /* There are no charsets in Drizzle */ + $GLOBALS['mysql_charsets'] = array(); + $GLOBALS['mysql_charsets_descriptions'] = array(); + $GLOBALS['mysql_charsets_count'] = 0; + $GLOBALS['mysql_charsets_available'] = array(); + $GLOBALS['mysql_collations'] = array(); + $GLOBALS['mysql_default_collations'] = array(); + $GLOBALS['mysql_collations_flat'] = array(); + $GLOBALS['mysql_collations_count'] = 0; + $GLOBALS['mysql_collations_available'] = array(); +} elseif (! PMA_cacheExists('mysql_charsets_count', true)) { $res = PMA_DBI_query('SHOW CHARACTER SET;');
$mysql_charsets = array();
hooks/post-receive