PMA_getDbCollation():
- preserve selected db - make use of PMA_DBI_select_db() - documentation
This commit is contained in:
@@ -8,6 +8,10 @@ $Source$
|
|||||||
2005-10-27 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
2005-10-27 Sebastian Mendel <cybot_tm@users.sourceforge.net>
|
||||||
* libraries/common.lib.php::PMA_formatNumber(),
|
* libraries/common.lib.php::PMA_formatNumber(),
|
||||||
db_details_structure.php: do not truncate rowcount
|
db_details_structure.php: do not truncate rowcount
|
||||||
|
* libraries/mysql_charsets.lib.php::PMA_getDbCollation():
|
||||||
|
- preserve selected db
|
||||||
|
- make use of PMA_DBI_select_db()
|
||||||
|
- documentation
|
||||||
|
|
||||||
2005-10-26 Marc Delisle <lem9@users.sourceforge.net>
|
2005-10-26 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lang/french* updates
|
* lang/french* updates
|
||||||
|
@@ -275,8 +275,18 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
return $descr;
|
return $descr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns collation of given db
|
||||||
|
*
|
||||||
|
* @uses PMA_MYSQL_INT_VERSION
|
||||||
|
* @uses PMA_DBI_fetch_value()
|
||||||
|
* @uses PMA_DBI_select_db()
|
||||||
|
* @uses PMA_sqlAddSlashes()
|
||||||
|
* @uses $GLOBALS['db']
|
||||||
|
* @param string $db name of db
|
||||||
|
* @return string collation of $db
|
||||||
|
*/
|
||||||
function PMA_getDbCollation( $db ) {
|
function PMA_getDbCollation( $db ) {
|
||||||
global $userlink;
|
|
||||||
if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
|
if (PMA_MYSQL_INT_VERSION >= 50000 && $db == 'information_schema') {
|
||||||
// We don't have to check the collation of the virtual
|
// We don't have to check the collation of the virtual
|
||||||
// information_schema database: We know it!
|
// information_schema database: We know it!
|
||||||
@@ -288,8 +298,12 @@ if (PMA_MYSQL_INT_VERSION >= 40100){
|
|||||||
} else if (PMA_MYSQL_INT_VERSION >= 40101) {
|
} 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.
|
||||||
PMA_DBI_query('USE ' . PMA_backQuote( addslashes( $db ) ) );
|
PMA_DBI_select_db( $db );
|
||||||
return PMA_DBI_fetch_value( 'SHOW VARIABLES LIKE "collation_database"', 0, 1 );
|
$return = PMA_DBI_fetch_value( 'SHOW VARIABLES LIKE "collation_database"', 0, 1 );
|
||||||
|
if ( ! empty( $GLOBALS['db'] ) && $db !== $GLOBALS['db'] ) {
|
||||||
|
PMA_DBI_select_db( $GLOBALS['db'] );
|
||||||
|
}
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user