bug #1832285 mysql DBI does not handle when control user connection fails

This commit is contained in:
Marc Delisle
2007-12-09 13:06:21 +00:00
parent 8be5ccc592
commit c7ba1bb032
2 changed files with 9 additions and 3 deletions

View File

@@ -1037,8 +1037,14 @@ function PMA_DBI_get_warnings($link = null)
* @return integer $is_superuser
*/
function PMA_isSuperuser() {
return PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user',
$GLOBALS['userlink'], PMA_DBI_QUERY_STORE);
// with mysql extension, when connection failed we don't have
// a $userlink
if (isset($GLOBALS['userlink'])) {
return PMA_DBI_try_query('SELECT COUNT(*) FROM mysql.user',
$GLOBALS['userlink'], PMA_DBI_QUERY_STORE);
} else {
return false;
}
}