bug #1370785, error browsing a table under PHP 4 when no controluser is defined but a pmadb is defined
This commit is contained in:
@@ -9,6 +9,8 @@ $Source$
|
|||||||
* tbl_properties_structure.php, lang/*: new $strBrowseDistinctValues
|
* tbl_properties_structure.php, lang/*: new $strBrowseDistinctValues
|
||||||
* Documentation.html: anchors and formatting cleanup,
|
* Documentation.html: anchors and formatting cleanup,
|
||||||
thanks to Cédric Corazza
|
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>
|
2005-12-09 Michal Čihař <michal@cihar.com>
|
||||||
* libraries/auth/http.auth.lib.php: Simplify code, use getenv, support for
|
* libraries/auth/http.auth.lib.php: Simplify code, use getenv, support for
|
||||||
|
@@ -26,7 +26,12 @@
|
|||||||
function PMA_query_as_cu($sql, $show_error = TRUE, $options = 0) {
|
function PMA_query_as_cu($sql, $show_error = TRUE, $options = 0) {
|
||||||
global $err_url_0, $db, $controllink, $cfgRelation;
|
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);
|
PMA_DBI_select_db($cfgRelation['db'], $controllink);
|
||||||
}
|
}
|
||||||
if ($show_error) {
|
if ($show_error) {
|
||||||
@@ -35,7 +40,7 @@
|
|||||||
$result = @PMA_DBI_try_query($sql, $controllink, $options);
|
$result = @PMA_DBI_try_query($sql, $controllink, $options);
|
||||||
} // end if... else...
|
} // end if... else...
|
||||||
// It makes no sense to restore database on control user
|
// 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);
|
PMA_DBI_select_db($db, $controllink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user