[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-12876-g55c6eac

Madhura Jayaratne madhuracj at users.sourceforge.net
Wed Aug 3 20:44:52 CEST 2011


The branch, master has been updated
       via  55c6eacf3e56da064dae69650480d84acd92d5a3 (commit)
       via  68e21b05e46f144735faa849b80734d83812c7e6 (commit)
       via  7909da2ea01b15aad44689c9cc59051d747d0381 (commit)
      from  c1f586b9fdc399ddc2cf86faa5a5e05194afa2e5 (commit)


- Log -----------------------------------------------------------------
commit 55c6eacf3e56da064dae69650480d84acd92d5a3
Merge: c1f586b9fdc399ddc2cf86faa5a5e05194afa2e5 68e21b05e46f144735faa849b80734d83812c7e6
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Thu Aug 4 00:07:04 2011 +0530

    Merge branch 'QA_3_4'

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |    1 +
 libraries/display_tbl.lib.php |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3cd0d8f..eea949e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,7 @@ phpMyAdmin - ChangeLog
 - bug #3375325 [interface] Page list in navigation frame looks odd
 - bug #3313235 [interface] Error div misplaced
 - bug #3374802 [interface] Comment on a column breaks inline editing
+- bug #3383711 [display] Order by a column in a view doesn't work in some cases
 
 3.4.4.0 (not yet released)
 - bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index af5dc89..b29b36a 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -842,8 +842,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
             // the orgname member does not exist for all MySQL versions
             // but if found, it's the one on which to sort
             $name_to_use_in_sort = $fields_meta[$i]->name;
+            $is_orgname = false;
             if (isset($fields_meta[$i]->orgname) && strlen($fields_meta[$i]->orgname)) {
                 $name_to_use_in_sort = $fields_meta[$i]->orgname;
+                $is_orgname = true;
             }
             // $name_to_use_in_sort might contain a space due to
             // formatting of function expressions like "COUNT(name )"
@@ -870,12 +872,15 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
             // 2.1.3 Check the field name for a bracket.
             //       If it contains one, it's probably a function column
             //       like 'COUNT(`field`)'
-            if (strpos($name_to_use_in_sort, '(') !== false) {
+            //       It still might be a column name of a view. See bug #3383711
+            //       Check is_orgname.
+            if (strpos($name_to_use_in_sort, '(') !== false && ! $is_orgname) {
                 $sort_order = ' ORDER BY ' . $name_to_use_in_sort . ' ';
             } else {
                 $sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($name_to_use_in_sort) . ' ';
             }
             unset($name_to_use_in_sort);
+            unset($is_orgname);
 
             // 2.1.4 Do define the sorting URL
             if (! $is_in_sort) {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list