From aaf9f775c41b3c7f71537214cfc0f4bd6e42d991 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 28 Jul 2012 12:04:37 +0530 Subject: [PATCH 1/2] White space cleanup --- libraries/relation.lib.php | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 4781511f47..43433bc9ca 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -79,7 +79,7 @@ function PMA_getRelationsParam() */ function PMA_getRelationsParamDiagnostic($cfgRelation) { - + $common_functions = PMA_CommonFunctions::getInstance(); $retval = ''; @@ -497,7 +497,7 @@ function PMA__getRelationsParam() */ function PMA_getForeigners($db, $table, $column = '', $source = 'both') { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); $foreign = array(); @@ -520,7 +520,7 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') if (($source == 'both' || $source == 'foreign') && strlen($table) && isset($analyzed_sql[0]['foreign_keys']) ) { - + $show_create_table_query = 'SHOW CREATE TABLE ' . $common_functions->backquote($db) . '.' . $common_functions->backquote($table); $show_create_table = PMA_DBI_fetch_value($show_create_table_query, 0, 1); @@ -605,7 +605,7 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') */ function PMA_getDisplayField($db, $table) { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); @@ -686,7 +686,7 @@ function PMA_getComments($db, $table = '') */ function PMA_getDbComment($db) { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); $comment = ''; @@ -720,7 +720,7 @@ function PMA_getDbComment($db) */ function PMA_getDbComments() { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); $comments = array(); @@ -756,7 +756,7 @@ function PMA_getDbComments() */ function PMA_setDbComment($db, $comment = '') { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); @@ -806,9 +806,9 @@ function PMA_setDbComment($db, $comment = '') */ function PMA_setHistory($db, $table, $username, $sqlquery) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + if (strlen($sqlquery) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { return; } @@ -868,7 +868,7 @@ function PMA_setHistory($db, $table, $username, $sqlquery) */ function PMA_getHistory($username) { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); @@ -901,7 +901,7 @@ function PMA_getHistory($username) */ function PMA_purgeHistory($username) { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); if (! $GLOBALS['cfg']['QueryHistoryDB'] || ! $cfgRelation['historywork']) { @@ -1089,9 +1089,9 @@ function PMA_foreignDropdown($disp_row, $foreign_field, $foreign_display, $data, function PMA_getForeignData($foreigners, $field, $override_total, $foreign_filter, $foreign_limit) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + // we always show the foreign field in the drop-down; if a display // field is defined, we show it besides the foreign field $foreign_link = false; @@ -1189,7 +1189,7 @@ function PMA_getRelatives($all_tables, $master) } else { $from = 'foreign'; $to = 'master'; - } + } $in_know = '(\'' . implode('\', \'', $known_tables) . '\')'; $in_left = '(\'' . implode('\', \'', $remaining_tables) . '\')'; $rel_query = 'SELECT *' @@ -1240,7 +1240,7 @@ function PMA_getRelatives($all_tables, $master) */ function PMA_REL_renameField($db, $table, $field, $new_name) { - + $common_functions = PMA_CommonFunctions::getInstance(); $cfgRelation = PMA_getRelationsParam(); @@ -1296,9 +1296,9 @@ function PMA_REL_renameSingleTable($table, $source_table, $target_table, $db_field, $table_field ) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + $query = 'UPDATE ' . $common_functions->backquote($GLOBALS['cfgRelation']['db']) . '.' . $common_functions->backquote($GLOBALS['cfgRelation'][$table]) @@ -1401,9 +1401,9 @@ function PMA_REL_renameTable($source_db, $target_db, $source_table, $target_tabl */ function PMA_REL_createPage($newpage, $cfgRelation, $db) { - + $common_functions = PMA_CommonFunctions::getInstance(); - + if (! isset($newpage) || $newpage == '') { $newpage = __('no description'); } @@ -1415,7 +1415,7 @@ function PMA_REL_createPage($newpage, $cfgRelation, $db) . $common_functions->sqlAddSlashes($db) . '\', \'' . $common_functions->sqlAddSlashes($newpage) . '\')'; PMA_queryAsControlUser($ins_query, false); - + return PMA_DBI_insert_id( isset($GLOBALS['controllink']) ? $GLOBALS['controllink'] : '' ); From 18da661f604444260801a44506db93ff536dc0a1 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 28 Jul 2012 12:05:58 +0530 Subject: [PATCH 2/2] Reverting 4465c287c. $analyzed_sql is not defined at this point --- libraries/relation.lib.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index 43433bc9ca..1fd2eae399 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -517,9 +517,7 @@ function PMA_getForeigners($db, $table, $column = '', $source = 'both') $foreign = PMA_DBI_fetch_result($rel_query, 'master_field', null, $GLOBALS['controllink']); } - if (($source == 'both' || $source == 'foreign') && strlen($table) - && isset($analyzed_sql[0]['foreign_keys']) - ) { + if (($source == 'both' || $source == 'foreign') && strlen($table)) { $show_create_table_query = 'SHOW CREATE TABLE ' . $common_functions->backquote($db) . '.' . $common_functions->backquote($table);