Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtul Pratap Singh <atulpratapsingh05@gmail.com>2012-07-10 19:56:45 +0400
committerAtul Pratap Singh <atulpratapsingh05@gmail.com>2012-07-10 19:56:45 +0400
commit9fe3a570f097267367dbd2f9dc2935d2a0e548c2 (patch)
tree799369d1b34176bbb483b2922c476227321acd8d /db_qbe.php
parent7024c4df9b5cd97ebe1c37bfb7045280a9bb3312 (diff)
Logical improvement in PMA_dbQbeGetOrderByClause
Diffstat (limited to 'db_qbe.php')
-rw-r--r--db_qbe.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/db_qbe.php b/db_qbe.php
index 36437ce145..2d0b0149f1 100644
--- a/db_qbe.php
+++ b/db_qbe.php
@@ -673,25 +673,22 @@ function PMA_dbQbeGetOrderByClause($criteria_column_count)
{
$last_orderby = 0;
$orderby_clause = '';
- for ($column_index = 0; $column_index < $criteria_column_count; $column_index++) {
- if ($last_orderby
- && $column_index
- && ! empty($GLOBALS['curField'][$column_index])
- && ! empty($GLOBALS['curSort'][$column_index])
- ) {
- $orderby_clause .= ', ';
- }
+ for ($column_index = 0; $column_index < $criteria_column_count; $column_index++)
+ {
+ // if all columns are chosen with * selector, then sorting isn't available
+ // Fix for Bug #570698
if (! empty($GLOBALS['curField'][$column_index])
&& ! empty($GLOBALS['curSort'][$column_index])
) {
- // if they have chosen all fields using the * selector,
- // then sorting is not available
- // Fix for Bug #570698
- if (substr($GLOBALS['curField'][$column_index], -2) != '.*') {
- $orderby_clause .= $GLOBALS['curField'][$column_index] . ' '
- . $GLOBALS['curSort'][$column_index];
- $last_orderby = 1;
+ if (substr($GLOBALS['curField'][$column_index], -2) == '.*') {
+ continue;
+ }
+ if ($last_orderby && $column_index) {
+ $orderby_clause .= ', ';
}
+ $orderby_clause .= $GLOBALS['curField'][$column_index] . ' '
+ . $GLOBALS['curSort'][$column_index];
+ $last_orderby = 1;
}
} // end for
if (! empty($orderby_clause)) {