Make use of this fancy new function PMA_DBI_fetch_value().
This commit is contained in:
@@ -284,23 +284,11 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
||||
}
|
||||
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 = \'' . PMA_sqlAddSlashes($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 '';
|
||||
}
|
||||
return PMA_DBI_fetch_value('SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = \'' . PMA_sqlAddSlashes($db) . '\' LIMIT 1;');
|
||||
} else if (PMA_MYSQL_INT_VERSION >= 40101) {
|
||||
// MySQL 4.1.0 does not support seperate charset settings
|
||||
// for databases.
|
||||
$res = PMA_DBI_query('SHOW CREATE DATABASE ' . PMA_backquote($db) . ';', NULL, PMA_DBI_QUERY_STORE);
|
||||
$row = PMA_DBI_fetch_row($res);
|
||||
PMA_DBI_free_result($res);
|
||||
$tokenized = explode(' ', $row[1]);
|
||||
unset($row, $res);
|
||||
$tokenized = explode(' ', PMA_DBI_fetch_value('SHOW CREATE DATABASE ' . PMA_backquote($db) . ';'));
|
||||
|
||||
for ($i = 1; $i + 3 < count($tokenized); $i++) {
|
||||
if ($tokenized[$i] == 'DEFAULT' && $tokenized[$i + 1] == 'CHARACTER' && $tokenized[$i + 2] == 'SET') {
|
||||
|
Reference in New Issue
Block a user