bug #1370785, error browsing a table under PHP 4 when no controluser is defined but a pmadb is defined

This commit is contained in:
Marc Delisle
2005-12-10 15:51:38 +00:00
parent 9535cdc246
commit 9cc77d6ecb
2 changed files with 9 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ $Source$
* tbl_properties_structure.php, lang/*: new $strBrowseDistinctValues
* Documentation.html: anchors and formatting cleanup,
thanks to Cédric Corazza
* libraries/relation.lib.php: bug #1370785, error browsing a table under
PHP 4 when no controluser is defined but a pmadb is defined
2005-12-09 Michal Čihař <michal@cihar.com>
* libraries/auth/http.auth.lib.php: Simplify code, use getenv, support for

View File

@@ -26,7 +26,12 @@
function PMA_query_as_cu($sql, $show_error = TRUE, $options = 0) {
global $err_url_0, $db, $controllink, $cfgRelation;
if ($controllink == $GLOBALS['userlink']) {
// Comparing resource ids works on PHP 5 because, when no controluser
// is defined, connecting with the same user for controllink does
// not create a new connection. However a new connection is created
// on PHP 4, so we cannot directly compare resource ids.
if ($controllink == $GLOBALS['userlink'] || PMA_MYSQL_INT_VERSION < 50000) {
PMA_DBI_select_db($cfgRelation['db'], $controllink);
}
if ($show_error) {
@@ -35,7 +40,7 @@
$result = @PMA_DBI_try_query($sql, $controllink, $options);
} // end if... else...
// It makes no sense to restore database on control user
if ($controllink == $GLOBALS['userlink']) {
if ($controllink == $GLOBALS['userlink'] || PMA_MYSQL_INT_VERSION < 50000) {
PMA_DBI_select_db($db, $controllink);
}