From c68ea6c71a2e4b52fd8c0f4c55b2476188419980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 15 Aug 2011 22:48:43 +0200 Subject: [PATCH 1/7] Cleanup --- po/de.po | 12 ------------ po/es.po | 12 ------------ po/zh_CN.po | 12 ------------ 3 files changed, 36 deletions(-) diff --git a/po/de.po b/po/de.po index 822ed74348..b1bd55893e 100644 --- a/po/de.po +++ b/po/de.po @@ -12907,18 +12907,6 @@ msgid "concurrent_insert is set to 0" msgstr "" #, fuzzy -#~| msgid "" -#~| "The Advisor system can provide recommendations on server variables by " -#~| "analyzing the server status variables. \n" -#~| " Do note however that this system provides recommendations based " -#~| "on fairly simple calculations and by rule of thumb and \n" -#~| " may not necessarily work for your system.\n" -#~| " Prior to changing any of the configuration, be sure to know what " -#~| "you are changing and how to undo the change. Wrong tuning\n" -#~| " can have a very negative effect on performance.\n" -#~| " The best way to tune the system would be to change only one " -#~| "setting at a time, observe or benchmark your database, and \n" -#~| " undo the change if there was no clearly measurable improvement." #~ msgid "" #~ "The Advisor system can provide recommendations on server variables by " #~ "analyzing the server status variables.

Do note however that this " diff --git a/po/es.po b/po/es.po index 8f2c69f206..ad03d35295 100644 --- a/po/es.po +++ b/po/es.po @@ -12959,18 +12959,6 @@ msgid "concurrent_insert is set to 0" msgstr "" #, fuzzy -#~| msgid "" -#~| "The Advisor system can provide recommendations on server variables by " -#~| "analyzing the server status variables.\n" -#~| " Do note however that this system provides recommendations based " -#~| "on fairly simple calculations and by rule of thumb and\n" -#~| " may not necessarily work for your system.\n" -#~| " Prior to changing any of the configuration, be sure to know what " -#~| "you are changing and how to undo the change. Wrong tuning\n" -#~| " can have a very negative effect on performance.\n" -#~| " The best way to tune the system would be to change only one " -#~| "setting at a time, observe or benchmark your database, and\n" -#~| " undo the change if there was no clearly measurable improvement." #~ msgid "" #~ "The Advisor system can provide recommendations on server variables by " #~ "analyzing the server status variables.

Do note however that this " diff --git a/po/zh_CN.po b/po/zh_CN.po index d8ee9f605f..4902bd6b5a 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -12325,18 +12325,6 @@ msgid "concurrent_insert is set to 0" msgstr "" #, fuzzy -#~| msgid "" -#~| "The Advisor system can provide recommendations on server variables by " -#~| "analyzing the server status variables.\n" -#~| " Do note however that this system provides recommendations based " -#~| "on fairly simple calculations and by rule of thumb and\n" -#~| " may not necessarily work for your system.\n" -#~| " Prior to changing any of the configuration, be sure to know what " -#~| "you are changing and how to undo the change. Wrong tuning\n" -#~| " can have a very negative effect on performance.\n" -#~| " The best way to tune the system would be to change only one " -#~| "setting at a time, observe or benchmark your database, and\n" -#~| " undo the change if there was no clearly measurable improvement." #~ msgid "" #~ "The Advisor system can provide recommendations on server variables by " #~ "analyzing the server status variables.

Do note however that this " From e2eb8a28dad7d07ab24c84685d388d4b230a4f92 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 16 Aug 2011 00:04:44 +0200 Subject: [PATCH 2/7] PMA_backquote is not needed for string literals --- db_tracking.php | 6 +++--- libraries/Tracker.class.php | 4 ++-- tbl_tracking.php | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/db_tracking.php b/db_tracking.php index df1106e83b..29d8cc85b1 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -67,9 +67,9 @@ require_once './libraries/db_links.inc.php'; $all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' . PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) . '.' . PMA_backquote($GLOBALS['cfg']['Server']['tracking']) . - ' WHERE ' . PMA_backquote('db_name') . ' = \'' . PMA_sqlAddSlashes($_REQUEST['db']) . '\' ' . - ' GROUP BY '. PMA_backquote('table_name') . - ' ORDER BY '. PMA_backquote('table_name') .' ASC'; + ' WHERE db_name = \'' . PMA_sqlAddSlashes($_REQUEST['db']) . '\' ' . + ' GROUP BY table_name' . + ' ORDER BY table_name ASC'; $all_tables_result = PMA_query_as_controluser($all_tables_query); diff --git a/libraries/Tracker.class.php b/libraries/Tracker.class.php index 947044aa24..aa176eafb7 100644 --- a/libraries/Tracker.class.php +++ b/libraries/Tracker.class.php @@ -219,8 +219,8 @@ class PMA_Tracker $sql_query = " SELECT tracking_active FROM " . self::$pma_table . - " WHERE " . PMA_backquote('db_name') . " = '" . PMA_sqlAddSlashes($dbname) . "' " . - " AND " . PMA_backquote('table_name') . " = '" . PMA_sqlAddSlashes($tablename) . "' " . + " WHERE db_name = '" . PMA_sqlAddSlashes($dbname) . "' " . + " AND table_name = '" . PMA_sqlAddSlashes($tablename) . "' " . " ORDER BY version DESC"; $row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query)); diff --git a/tbl_tracking.php b/tbl_tracking.php index 76ed16ab33..b601348ea4 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -575,8 +575,8 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) { $sql_query = " SELECT DISTINCT db_name, table_name FROM " . PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) . "." . PMA_backquote($GLOBALS['cfg']['Server']['tracking']) . - " WHERE " . PMA_backquote('db_name') . " = '" . PMA_sqlAddSlashes($GLOBALS['db']) . "' " . - " ORDER BY ". PMA_backquote('db_name') . ", " . PMA_backquote('table_name'); + " WHERE db_name = '" . PMA_sqlAddSlashes($GLOBALS['db']) . "' " . + " ORDER BY db_name, table_name"; $sql_result = PMA_query_as_controluser($sql_query); @@ -615,9 +615,9 @@ if (PMA_DBI_num_rows($sql_result) > 0) { $sql_query = " SELECT * FROM " . PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) . "." . PMA_backquote($GLOBALS['cfg']['Server']['tracking']) . - " WHERE " . PMA_backquote('db_name') . " = '" . PMA_sqlAddSlashes($_REQUEST['db']) . "' ". - " AND " . PMA_backquote('table_name') . " = '" . PMA_sqlAddSlashes($_REQUEST['table']) ."' ". - " ORDER BY ". PMA_backquote('version') . " DESC "; + " WHERE db_name = '" . PMA_sqlAddSlashes($_REQUEST['db']) . "' ". + " AND table_name = '" . PMA_sqlAddSlashes($_REQUEST['table']) ."' ". + " ORDER BY version DESC "; $sql_result = PMA_query_as_controluser($sql_query); From cc4743d396e4754d30a81458e4ecb4aca33fc9d0 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 16 Aug 2011 00:05:26 +0200 Subject: [PATCH 3/7] 'comment' is not a reserved keyword, remove PMA_backquote --- libraries/Table.class.php | 4 ++-- libraries/import/docsql.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/Table.class.php b/libraries/Table.class.php index 512ca2e782..d018cd762f 100644 --- a/libraries/Table.class.php +++ b/libraries/Table.class.php @@ -910,7 +910,7 @@ class PMA_Table if ($GLOBALS['cfgRelation']['commwork']) { // Get all comments and MIME-Types for current table $comments_copy_query = 'SELECT - column_name, ' . PMA_backquote('comment') . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ' + column_name, comment' . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ' FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) . ' WHERE db_name = \'' . PMA_sqlAddSlashes($source_db) . '\' AND @@ -920,7 +920,7 @@ class PMA_Table // Write every comment as new copied entry. [MIME] while ($comments_copy_row = PMA_DBI_fetch_assoc($comments_copy_rs)) { $new_comment_query = 'REPLACE INTO ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['column_info']) - . ' (db_name, table_name, column_name, ' . PMA_backquote('comment') . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ') ' + . ' (db_name, table_name, column_name, comment' . ($GLOBALS['cfgRelation']['mimework'] ? ', mimetype, transformation, transformation_options' : '') . ') ' . ' VALUES(' . '\'' . PMA_sqlAddSlashes($target_db) . '\',' . '\'' . PMA_sqlAddSlashes($target_table) . '\',' diff --git a/libraries/import/docsql.php b/libraries/import/docsql.php index 4ba089a5ec..4710940c23 100644 --- a/libraries/import/docsql.php +++ b/libraries/import/docsql.php @@ -66,7 +66,7 @@ if ($data === true && !$error && !$timeout_passed) { $qry = ' INSERT INTO ' . PMA_backquote($cfgRelation['db']) . '.' . PMA_backquote($cfgRelation['column_info']) . ' - (db_name, table_name, column_name, ' . PMA_backquote('comment') . ') + (db_name, table_name, column_name, comment) VALUES ( \'' . PMA_sqlAddSlashes($GLOBALS['db']) . '\', \'' . PMA_sqlAddSlashes(trim($tab)) . '\', From 73485871c7770dcbe263dcb08aec54c18f70678b Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 16 Aug 2011 00:05:51 +0200 Subject: [PATCH 4/7] PMA_backquote is not needed here --- libraries/schema/User_Schema.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index aa17c4717b..5d925cc187 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -685,7 +685,7 @@ class PMA_User_Schema . ' FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation']) . ' WHERE master_db = \'' . $db . '\'' . ' GROUP BY master_table' - . ' ORDER BY ' . PMA_backquote('COUNT(master_table)') . ' DESC '; + . ' ORDER BY COUNT(master_table) DESC'; $master_tables_rs = PMA_query_as_controluser($master_tables, false, PMA_DBI_QUERY_STORE); if ($master_tables_rs && PMA_DBI_num_rows($master_tables_rs) > 0) { /* first put all the master tables at beginning From fd441451832312cb5c76c46be80d075f0e8fa435 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 16 Aug 2011 00:07:57 +0200 Subject: [PATCH 5/7] Add missing PMA_sqlAddSlashes --- libraries/schema/User_Schema.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index 5d925cc187..51694aaf6c 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -683,7 +683,7 @@ class PMA_User_Schema */ $master_tables = 'SELECT COUNT(master_table), master_table' . ' FROM ' . PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation']) - . ' WHERE master_db = \'' . $db . '\'' + . ' WHERE master_db = \'' . PMA_sqlAddSlashes($db) . '\'' . ' GROUP BY master_table' . ' ORDER BY COUNT(master_table) DESC'; $master_tables_rs = PMA_query_as_controluser($master_tables, false, PMA_DBI_QUERY_STORE); From 824fac0da5af56dbad589cebe47a1f3587d022fc Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 16 Aug 2011 00:09:04 +0200 Subject: [PATCH 6/7] Import missing variable into method's scope --- libraries/schema/User_Schema.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index 51694aaf6c..986efada4d 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -441,6 +441,7 @@ class PMA_User_Schema */ private function _deleteTables($db, $chpage, $tabExist) { + global $table; $_strtrans = ''; $_strname = ''; $shoot = false; From 3782a6c89b1ef507d6a777e68509870c7ac3020c Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Tue, 16 Aug 2011 00:34:44 +0200 Subject: [PATCH 7/7] Remove JS function: getElement --- js/functions.js | 20 -------------------- libraries/schema/User_Schema.class.php | 16 ++++++++-------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/js/functions.js b/js/functions.js index ee83b8acfd..d1c554436c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -902,26 +902,6 @@ function goToUrl(selObj, goToLocation) eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'"); } -/** - * getElement - */ -function getElement(e,f) -{ - if(document.layers){ - f=(f)?f:self; - if(f.document.layers[e]) { - return f.document.layers[e]; - } - for(W=0;W TableDragInit(); } function TableDragInit() { - myid = getElement('pdflayout'); + myid = $('#pdflayout')[0]; }