From bda213a5ac69136a6cf7d96e5ba36d032d718e36 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 11 Aug 2010 10:48:05 -0400 Subject: [PATCH] bug #3042706 [pmadb] Relations, bookmarks, etc deleted after table drop --- ChangeLog | 1 + libraries/header.inc.php | 5 ++++- sql.php | 5 +++++ tbl_operations.php | 4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f61fac728..4b6bda786 100644 --- a/ChangeLog +++ b/ChangeLog @@ -115,6 +115,7 @@ $Id$ thanks to Will Palmer - wpalmer - bug #3040226 [XHTML] LockFromUpdate checkbox not checked by default - bug [doc] Withdraw or edit FAQ entries related to older MySQL or PHP +- bug #3042706 [pmadb] Relations, bookmarks, etc deleted after table drop 3.3.5.0 (2010-07-26) - patch #2932113 [information_schema] Slow export when having lots of diff --git a/libraries/header.inc.php b/libraries/header.inc.php index 56385836b..c6f71079e 100644 --- a/libraries/header.inc.php +++ b/libraries/header.inc.php @@ -114,7 +114,10 @@ if (empty($GLOBALS['is_header_sent'])) { __('New table'), '', 's_tbl.png'); - } elseif (strlen($GLOBALS['table'])) { + // if the table is being dropped, $_REQUEST['purge'] is set + // (it always contains "1") + // so do not display the table name in upper div + } elseif (strlen($GLOBALS['table']) && ! (isset($_REQUEST['purge']))) { require_once './libraries/tbl_info.inc.php'; echo $separator; diff --git a/sql.php b/sql.php index ed6f7d447..a98b9d480 100644 --- a/sql.php +++ b/sql.php @@ -530,7 +530,12 @@ if (0 == $num_rows || $is_affected) { $goto = PMA_securePath($goto); // Checks for a valid target script $is_db = $is_table = false; + if (isset($_REQUEST['purge'])) { + $table = ''; + unset($url_params['table']); + } include 'libraries/db_table_exists.lib.php'; + if (strpos($goto, 'tbl_') === 0 && ! $is_table) { if (strlen($table)) { $table = ''; diff --git a/tbl_operations.php b/tbl_operations.php index e2de481cb..666f6f331 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -668,7 +668,9 @@ if (! (isset($db_is_information_schema) && $db_is_information_schema)) { 'reload' => '1', 'purge' => '1', 'zero_rows' => sprintf(($tbl_is_view ? __('View %s has been dropped') : __('Table %s has been dropped')), htmlspecialchars($table)), - 'table' => NULL, + // table name is needed to avoid running + // PMA_relationsCleanupDatabase() on the whole db later + 'table' => $GLOBALS['table'], )); ?>