Bug #4135 When searching, error "No database selected"

This commit is contained in:
Marc Delisle 2013-10-15 15:36:13 -04:00
parent e10c230541
commit effa00f209
2 changed files with 3 additions and 2 deletions

View File

@ -1319,7 +1319,8 @@ function PMA_hasCurrentDbChanged($db)
$reload = 0;
if (strlen($db)) {
$current_db = $GLOBALS['dbi']->fetchValue('SELECT DATABASE()');
if ($db !== $current_db) {
// $current_db is false, except when a USE statement was sent
if ($current_db != false && $db !== $current_db) {
$reload = 1;
}
}
@ -2286,6 +2287,7 @@ function PMA_executeQueryAndSendQueryResponse($analyzed_sql_results,
}
$GLOBALS['reload'] = PMA_hasCurrentDbChanged($db);
$GLOBALS['dbi']->selectDb($db);
// Execute the query
list($result, $num_rows, $unlim_num_rows, $profiling_results,

View File

@ -173,7 +173,6 @@ if ($goto == 'sql.php') {
);
} // end if
$GLOBALS['dbi']->selectDb($db);
PMA_executeQueryAndSendQueryResponse(
$analyzed_sql_results,
$is_gotofile,