diff --git a/ChangeLog b/ChangeLog index 9c01b0282..8c751a6e2 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-10-18 Michal Čihař + * libraries/relation.lib.php: Do not set database if not needed. + 2005-10-18 Sebastian Mendel * querywindow.php: wrong handling of linebreaks in query: bug #1243888 * left.php, sql.php, tbl_change.php, libraries/common.lib.php, diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 5049fb0b7..bea982254 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -26,7 +26,9 @@ function PMA_query_as_cu($sql, $show_error = TRUE, $options = 0) { global $err_url_0, $db, $dbh, $cfgRelation; - PMA_DBI_select_db($cfgRelation['db'], $dbh); + if ($dbh == $GLOBALS['userlink']) { + PMA_DBI_select_db($cfgRelation['db'], $dbh); + } if ($show_error) { $result = PMA_DBI_query($sql, $dbh, $options); } else { @@ -67,7 +69,7 @@ */ function PMA_getRelationsParam($verbose = FALSE) { - global $cfg, $server, $err_url_0, $db, $table; + global $cfg, $server, $err_url_0, $db, $table, $dbh; global $cfgRelation; $cfgRelation = array(); @@ -104,6 +106,7 @@ function PMA_getRelationsParam($verbose = FALSE) // I was thinking of checking if they have all required columns but I // fear it might be too slow + PMA_DBI_select_db($cfgRelation['db'], $dbh); $tab_query = 'SHOW TABLES FROM ' . PMA_backquote($cfgRelation['db']); $tab_rs = PMA_query_as_cu($tab_query, FALSE, PMA_DBI_QUERY_STORE);