From e1f455d0727b68e944d2732c915bec87229207c3 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 8 Aug 2005 19:54:57 +0000 Subject: [PATCH] patch #1253461, code cleanup --- ChangeLog | 3 +++ libraries/mysql_charsets.lib.php | 2 +- libraries/relation_cleanup.lib.php | 32 +++++++++++++++--------------- libraries/tbl_move_copy.php | 2 +- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdcd1bbb2..224ab87f0 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ $Source$ 2005-08-08 Marc Delisle * libraries/dbi/mysqli.dbi.lib.php: bug #1253453, using mysqli extension with MySQL 4.0.x + * libraries/mysql_charsets.lib.php, /relation_cleanup.lib.php, + /tbl_move_copy.php: patch #1253461 (code cleanup), + thanks to Sebastian Mendel 2005-08-07 Marc Delisle * Documentation.html: Save button for PDF schema coordinates, diff --git a/libraries/mysql_charsets.lib.php b/libraries/mysql_charsets.lib.php index 498ac8aab..2a96b126a 100644 --- a/libraries/mysql_charsets.lib.php +++ b/libraries/mysql_charsets.lib.php @@ -286,7 +286,7 @@ if (PMA_MYSQL_INT_VERSION >= 40100){ $row = PMA_DBI_fetch_row($res); PMA_DBI_free_result($res); $tokenized = explode(' ', $row[1]); - unset($row, $res, $sql_query); + unset($row, $res); for ($i = 1; $i + 3 < count($tokenized); $i++) { if ($tokenized[$i] == 'DEFAULT' && $tokenized[$i + 1] == 'CHARACTER' && $tokenized[$i + 2] == 'SET') { diff --git a/libraries/relation_cleanup.lib.php b/libraries/relation_cleanup.lib.php index 8c9d3105c..9933a7312 100644 --- a/libraries/relation_cleanup.lib.php +++ b/libraries/relation_cleanup.lib.php @@ -18,7 +18,7 @@ function PMA_relationsCleanupColumn($db, $table, $column) { . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'' . ' AND column_name = \'' . PMA_sqlAddslashes(urldecode($column)) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['displaywork']) { @@ -27,7 +27,7 @@ function PMA_relationsCleanupColumn($db, $table, $column) { . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'' . ' AND display_field = \'' . PMA_sqlAddslashes(urldecode($column)) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['relwork']) { @@ -36,14 +36,14 @@ function PMA_relationsCleanupColumn($db, $table, $column) { . ' AND master_table = \'' . PMA_sqlAddslashes($table) . '\'' . ' AND master_field = \'' . PMA_sqlAddslashes(urldecode($column)) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['relation']) . ' WHERE foreign_db = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND foreign_table = \'' . PMA_sqlAddslashes($table) . '\'' . ' AND foreign_field = \'' . PMA_sqlAddslashes(urldecode($column)) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } } @@ -55,7 +55,7 @@ function PMA_relationsCleanupTable($db, $table) { . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['displaywork']) { @@ -63,7 +63,7 @@ function PMA_relationsCleanupTable($db, $table) { . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['pdfwork']) { @@ -71,7 +71,7 @@ function PMA_relationsCleanupTable($db, $table) { . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['relwork']) { @@ -79,13 +79,13 @@ function PMA_relationsCleanupTable($db, $table) { . ' WHERE master_db = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND master_table = \'' . PMA_sqlAddslashes($table) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['relation']) . ' WHERE foreign_db = \'' . PMA_sqlAddslashes($db) . '\'' . ' AND foreign_table = \'' . PMA_sqlAddslashes($table) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } } @@ -96,45 +96,45 @@ function PMA_relationsCleanupDatabase($db) { $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['column_info']) . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['bookmarkwork']) { $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['bookmark']) . ' WHERE dbase = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['displaywork']) { $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_info']) . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['pdfwork']) { $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['pdf_pages']) . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['table_coords']) . ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } if ($cfgRelation['relwork']) { $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['relation']) . ' WHERE master_db = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); $remove_query = 'DELETE FROM ' . PMA_backquote($cfgRelation['relation']) . ' WHERE foreign_db = \'' . PMA_sqlAddslashes($db) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } } diff --git a/libraries/tbl_move_copy.php b/libraries/tbl_move_copy.php index 118342a65..2f50acd38 100644 --- a/libraries/tbl_move_copy.php +++ b/libraries/tbl_move_copy.php @@ -220,7 +220,7 @@ function PMA_table_move_copy($source_db, $source_table, $target_db, $target_tabl . ' WHERE db_name = \'' . PMA_sqlAddslashes($source_db) . '\'' . ' AND table_name = \'' . PMA_sqlAddslashes($source_table) . '\''; $rmv_rs = PMA_query_as_cu($remove_query); - unset($rmv_query); + unset($remove_query); } // garvin: updating bookmarks is not possible since only a single table is moved,