From b55ba34d43138b11b71d8eeae6b09ea160ded213 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 11 Jul 2010 08:00:42 -0400 Subject: [PATCH] bug #3023507 [core] No result set display from stored procedure SELECT --- ChangeLog | 1 + libraries/db_common.inc.php | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc0822bb2..de56291a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #3026400 [PHP] ereg functions are deprecated - bug #3027557 [PHP] split() deprecated in PHP 5.3 (backport fixes from master, todo: update PHP excel?) +- bug #3023507 [core] No result set display from stored procedure SELECT 3.3.4.0 (2010-06-28) - bug #2996161 [import] properly escape import value diff --git a/libraries/db_common.inc.php b/libraries/db_common.inc.php index 955e7c8c5..5d1699546 100644 --- a/libraries/db_common.inc.php +++ b/libraries/db_common.inc.php @@ -37,12 +37,19 @@ $err_url = $cfg['DefaultTabDatabase'] . '?' . PMA_generate_common_url($db); * Ensures the database exists (else move to the "parent" script) and displays * headers */ -if (!isset($is_db) || !$is_db) { - // Not a valid db name -> back to the welcome page +if (! isset($is_db) || ! $is_db) { if (strlen($db)) { $is_db = PMA_DBI_select_db($db); + // This "Command out of sync" 2014 error may happen, for example + // after calling a MySQL procedure; at this point we can't select + // the db but it's not necessarily wrong + if (PMA_DBI_getError() && $GLOBALS['errno'] == 2014) { + $is_db = true; + unset($GLOBALS['errno']); + } } - if (! strlen($db) || !$is_db) { + // Not a valid db name -> back to the welcome page + if (! strlen($db) || ! $is_db) { PMA_sendHeaderLocation($cfg['PmaAbsoluteUri'] . 'main.php?' . PMA_generate_common_url('', '', '&') . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); exit; }