On MySQL 5.0.6, we don't have to parse SHOW CREATE DATABASE anymore, if we just want to get to know a database's default collation.
This commit is contained in:
@@ -5,7 +5,12 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
2005-10-19 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
2005-10-20 Alexander M. Turek <me@derrabus.de>
|
||||||
|
* libraries/mysql_charsets.lib.php: On MySQL 5.0.6, we don't have to parse
|
||||||
|
SHOW CREATE DATABASE anymore, if we just want to get to know a
|
||||||
|
database's default collation.
|
||||||
|
|
||||||
|
2005-10-20 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
* sql.php, footer.inc.php: refresh left frame on view creation
|
* sql.php, footer.inc.php: refresh left frame on view creation
|
||||||
* left.php: view icon for views
|
* left.php: view icon for views
|
||||||
* libraries/left.js: dropped
|
* libraries/left.js: dropped
|
||||||
|
@@ -282,7 +282,18 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
// information_schema database: We know it!
|
// information_schema database: We know it!
|
||||||
return 'utf8_general_ci';
|
return 'utf8_general_ci';
|
||||||
}
|
}
|
||||||
if (PMA_MYSQL_INT_VERSION >= 40101) {
|
if (PMA_MYSQL_INT_VERSION >= 50006) {
|
||||||
|
// Since MySQL 5.0.6, we don't have to parse SHOW CREATE DATABASE anymore.
|
||||||
|
$res = PMA_DBI_query('SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = ' . $db . ' LIMIT 1;');
|
||||||
|
if ($res) {
|
||||||
|
list($db_collation) = PMA_DBI_fetch_row($res);
|
||||||
|
PMA_DBI_free_result($res);
|
||||||
|
return $db_collation;
|
||||||
|
} else {
|
||||||
|
// If we get here, the database does not exist or our MySQL server plays silly games on us...
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
} else if (PMA_MYSQL_INT_VERSION >= 40101) {
|
||||||
// MySQL 4.1.0 does not support seperate charset settings
|
// MySQL 4.1.0 does not support seperate charset settings
|
||||||
// for databases.
|
// for databases.
|
||||||
$res = PMA_DBI_query('SHOW CREATE DATABASE ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
$res = PMA_DBI_query('SHOW CREATE DATABASE ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
||||||
|
Reference in New Issue
Block a user