From cf1303f0fef75e9e0f604a6fb80234c7b9ec132e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 29 Dec 2007 20:38:27 +0000 Subject: [PATCH] Avoid a No tables found when deleting the last table of a db and the table limit offset becomes greater than the number of tables --- libraries/common.lib.php | 5 +++++ sql.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 6a257463b..89419d8f0 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -902,6 +902,11 @@ function PMA_reloadNavigation() // Reloads the navigation frame via JavaScript if required if (isset($GLOBALS['reload']) && $GLOBALS['reload']) { + // one of the reasons for a reload is when a table is dropped + // in this case, get rid of the table limit offset, otherwise + // we have a problem when dropping a table on the last page + // and the offset becomes greater than the total number of tables + unset($_SESSION['table_limit_offset']); echo "\n"; $reload_url = './navigation.php?' . PMA_generate_common_url($GLOBALS['db'], '', '&'); ?> diff --git a/sql.php b/sql.php index 6d927e84a..99a9b5a3f 100644 --- a/sql.php +++ b/sql.php @@ -204,14 +204,14 @@ if ($do_confirm) { // Defines some variables -// A table has to be created or renamed -> left frame should be reloaded +// A table has to be created, renamed, dropped -> navi frame should be reloaded /** * @todo use the parser/analyzer */ if (empty($reload) && preg_match('/^(CREATE|ALTER|DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) { - $reload = 1; + $reload = 1; } // SK -- Patch: $is_group added for use in calculation of total number of