Skip to content

Commit

Permalink
Remove some extraneous new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
madhuracj committed Sep 26, 2012
1 parent 43fde05 commit 12224e2
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
&& isset($_REQUEST['relation_key_or_display_column'])
&& $_REQUEST['relation_key_or_display_column']
) {
$curr_value = $_REQUEST['relation_key_or_display_column'];
$curr_value = $_REQUEST['relation_key_or_display_column'];
} else {
$curr_value = $_REQUEST['curr_value'];
}
Expand Down Expand Up @@ -528,9 +528,7 @@
&& isset($analyzed_sql[0]['queryflags']['select_from'])
&& count($analyzed_sql[0]['table_ref']) == 1
) {

PMA_handleSortOrder($db, $table, $analyzed_sql, $full_sql_query);

}

$sql_limit_to_append = ' LIMIT ' . $_SESSION['tmp_user_values']['pos']
Expand Down Expand Up @@ -568,7 +566,6 @@
. $analyzed_display_query[0]['section_after_limit'];
}
}

}

if (strlen($db)) {
Expand Down Expand Up @@ -725,15 +722,13 @@

// However, do not count again if we did it previously
// due to $find_real_end == true

if (! $is_group
&& ! isset($analyzed_sql[0]['queryflags']['union'])
&& ! isset($analyzed_sql[0]['queryflags']['distinct'])
&& ! isset($analyzed_sql[0]['table_ref'][1]['table_name'])
&& (empty($analyzed_sql[0]['where_clause']) || $analyzed_sql[0]['where_clause'] == '1 ')
&& ! isset($find_real_end)
) {

// "j u s t b r o w s i n g"
$unlim_num_rows = PMA_Table::countRecords($db, $table);

Expand Down Expand Up @@ -830,32 +825,26 @@

// No rows returned -> move back to the calling page
if ((0 == $num_rows && 0 == $unlim_num_rows) || $is_affected) {

// Delete related tranformation information
if (!empty($analyzed_sql[0]['querytype'])
&& (($analyzed_sql[0]['querytype'] == 'ALTER')
|| ($analyzed_sql[0]['querytype'] == 'DROP'))
) {

include_once 'libraries/transformations.lib.php';
if ($analyzed_sql[0]['querytype'] == 'ALTER') {

if (stripos($analyzed_sql[0]['unsorted_query'], 'DROP') !== false) {

$drop_column = PMA_getColumnNameInColumnDropSql(
$analyzed_sql[0]['unsorted_query']
);

if ($drop_column != '') {
PMA_clearTransformations($db, $table, $drop_column);
}

}

} else if (($analyzed_sql[0]['querytype'] == 'DROP') && ($table != '')) {
PMA_clearTransformations($db, $table);
}

}

if ($is_delete) {
Expand Down Expand Up @@ -1015,17 +1004,13 @@
if (!empty($sql_data) && ($sql_data['valid_queries'] > 1)) {

$_SESSION['is_multi_query'] = true;

echo getTableHtmlForMultipleQueries(
$displayResultsObject, $db, $sql_data, $goto,
$pmaThemeImage, $text_dir, $printview, $url_query,
$disp_mode, $sql_limit_to_append
);

} else {

$_SESSION['is_multi_query'] = false;

$displayResultsObject->setProperties(
$unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func,
$is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage,
Expand All @@ -1038,7 +1023,6 @@
);
exit();
}

}

// Displays the headers
Expand Down Expand Up @@ -1082,7 +1066,6 @@
}
echo "</p>";
} else {

$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
Expand Down Expand Up @@ -1203,17 +1186,13 @@
if (! empty($sql_data) && ($sql_data['valid_queries'] > 1) || $is_procedure) {

$_SESSION['is_multi_query'] = true;

echo getTableHtmlForMultipleQueries(
$displayResultsObject, $db, $sql_data, $goto,
$pmaThemeImage, $text_dir, $printview, $url_query,
$disp_mode, $sql_limit_to_append
);

} else {

$_SESSION['is_multi_query'] = false;

$displayResultsObject->setProperties(
$unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func,
$is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage,
Expand Down Expand Up @@ -1318,7 +1297,6 @@
*/
function PMA_getDisplayPropertyParams($sql_query, $is_select)
{

$is_explain = $is_count = $is_export = $is_delete = $is_insert = $is_affected = $is_show = $is_maint = $is_analyse = $is_group = $is_func = $is_replace = false;

if ($is_select) {
Expand Down Expand Up @@ -1350,7 +1328,6 @@ function PMA_getDisplayPropertyParams($sql_query, $is_select)
$is_group, $is_func, $is_count, $is_export, $is_analyse, $is_explain,
$is_delete, $is_affected, $is_insert, $is_replace,$is_show, $is_maint
);

}

/**
Expand Down Expand Up @@ -1386,7 +1363,6 @@ function PMA_getNewDatabase($sql, $databases)
*/
function PMA_getTableNameBySQL($sql, $tables)
{

$table = '';

// loop through all the tables in the database
Expand All @@ -1402,7 +1378,6 @@ function PMA_getTableNameBySQL($sql, $tables)
}

return trim($table);

}


Expand All @@ -1426,7 +1401,6 @@ function getTableHtmlForMultipleQueries(
$displayResultsObject, $db, $sql_data, $goto, $pmaThemeImage,
$text_dir, $printview, $url_query, $disp_mode, $sql_limit_to_append
) {

$table_html = '';

$tables_array = PMA_DBI_get_tables($db);
Expand All @@ -1443,7 +1417,6 @@ function getTableHtmlForMultipleQueries(
$sql_no = 0;

do {

$analyzed_sql = array();
$is_affected = false;

Expand All @@ -1455,7 +1428,6 @@ function getTableHtmlForMultipleQueries(

// Initialize needed params related to each query in multiquery statement
if (isset($sql_data['valid_sql'][$sql_no])) {

// 'Use' query can change the database
if (stripos($sql_data['valid_sql'][$sql_no], "use ")) {
$db = PMA_getNewDatabase(
Expand Down Expand Up @@ -1518,7 +1490,6 @@ function getTableHtmlForMultipleQueries(
$displayResultsObject->__set('_db', $db);
$displayResultsObject->__set('_table', $table);
$displayResultsObject->__set('_goto', $goto);

}

if (! $is_affected) {
Expand All @@ -1539,7 +1510,6 @@ function getTableHtmlForMultipleQueries(
$text_dir, $is_maint, $is_explain, $is_show, $showtable,
$printview, $url_query
);

}

if ($num_rows == 0) {
Expand All @@ -1563,7 +1533,6 @@ function getTableHtmlForMultipleQueries(
} while (PMA_DBI_more_results() && PMA_DBI_next_result());

return $table_html;

}

/**
Expand All @@ -1578,7 +1547,6 @@ function getTableHtmlForMultipleQueries(
*/
function PMA_handleSortOrder($db, $table, &$analyzed_sql, &$full_sql_query)
{

$pmatable = new PMA_Table($table, $db);
if (empty($analyzed_sql[0]['order_by_clause'])) {
$sorted_col = $pmatable->getUiProp(PMA_Table::PROP_SORTED_COLUMN);
Expand All @@ -1600,7 +1568,6 @@ function PMA_handleSortOrder($db, $table, &$analyzed_sql, &$full_sql_query)
$analyzed_sql[0]['order_by_clause']
);
}

}

/**
Expand Down Expand Up @@ -1629,7 +1596,6 @@ function PMA_getSqlWithLimitClause($full_sql_query, $analyzed_sql,
*/
function PMA_getColumnNameInColumnDropSql($sql)
{

$tmpArray1 = explode('DROP', $sql);
$str_to_check = trim($tmpArray1[1]);

Expand All @@ -1645,7 +1611,6 @@ function PMA_getColumnNameInColumnDropSql($sql)
$drop_column = str_replace('`', '', $drop_column);

return $drop_column;

}

?>

0 comments on commit 12224e2

Please sign in to comment.