From 789ed0d3d122f2165365cb5285b52c9885e6bffe Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 29 Sep 2011 06:08:30 -0400 Subject: [PATCH 1/3] A table has been dropped from outside phpMyAdmin --- libraries/schema/User_Schema.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index cb42dde2c2..17c2d391cd 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -491,10 +491,12 @@ class PMA_User_Schema $local_query = 'SHOW FIELDS FROM ' . PMA_backquote($temp_sh_page['table_name']) . ' FROM ' . PMA_backquote($db); - $fields_rs = PMA_DBI_query($local_query); + $fields_rs = PMA_DBI_try_query($local_query); unset($local_query); - $fields_cnt = PMA_DBI_num_rows($fields_rs); - + // the table has been dropped from outside phpMyAdmin + if (PMA_DBI_getError()) { + continue; + } echo '
' . $temp_sh_page['table_name'] . ''; if (isset($with_field_names)) { while ($row = PMA_DBI_fetch_assoc($fields_rs)) { From acbbd8fc56f45cdb648e52c3389e4cccf925f400 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 29 Sep 2011 06:41:06 -0400 Subject: [PATCH 2/3] bug #3392150 [schema] PMA_User_Schema::processUserChoice() is broken --- ChangeLog | 1 + libraries/schema/User_Schema.class.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec2549ff58..1746f5b77f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ phpMyAdmin - ChangeLog - bug #3324161 [core] CSP policy causing designer JS buttons to fail - bug #3412862 [relation] Relations/constraints are dropped/created on every change - bug #3390832 [display] Delete records from last page breaks search +- bug #3392150 [schema] PMA_User_Schema::processUserChoice() is broken 3.4.5.0 (2011-09-14) - bug #3375325 [interface] Page list in navigation frame looks odd diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index 17c2d391cd..310ffecc73 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -66,7 +66,7 @@ class PMA_User_Schema $this->_editCoordinates($db, $cfgRelation,$query_default_option); break; case 'delete_old_references': - $this->_deleteTableRows($delrow,$cfgRelation,$db,$this->chosenPage); + $this->_deleteTableRows($_POST['delrow'], $cfgRelation, $db, $_POST['chpage']); break; case 'process_export': $this->_processExportSchema(); @@ -318,7 +318,7 @@ class PMA_User_Schema echo "\n" . '' . "\n\n"; } // end if - $this->_deleteTables($db, $this->chosenPage, isset($tabExist)); + $this->_deleteTables($db, $this->chosenPage, $tabExist); } /** @@ -438,7 +438,7 @@ class PMA_User_Schema } if ($shoot) { echo '
' . "\n" - . PMA_generate_common_hidden_inputs($db, $table) + . PMA_generate_common_hidden_inputs($db) . '' . "\n" . '' . "\n" . __('The current page has references to tables that no longer exist. Would you like to delete those references?') From 963f478fdd0b2a3cd815b7dc7bbbae2d9a2fa1fd Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 29 Sep 2011 07:12:57 -0400 Subject: [PATCH 3/3] Fix merge conflicts --- libraries/schema/User_Schema.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index 9c31fbed86..26100b3ee6 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -84,10 +84,10 @@ class PMA_User_Schema break; case 'delete_old_references': $this->_deleteTableRows( - $delrow, + $_POST['delrow'], $cfgRelation, $db, - $this->chosenPage + $_POST['chpage'] ); break; case 'process_export': @@ -352,7 +352,9 @@ class PMA_User_Schema echo "\n" . '' . "\n\n"; } // end if - $this->_deleteTables($db, $this->chosenPage, $tabExist); + if (isset($tabExist)) { + $this->_deleteTables($db, $this->chosenPage, $tabExist); + } } /**