diff --git a/ChangeLog b/ChangeLog index 1a612d531..b5c903c75 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - ChangeLog $Id$ $Source$ +2006-08-16 Marc Delisle + * libraries/sqlparser.lib.php: sorting on column header + 2006-08-16 Michal Čihař * libraries/export/htmlexcel.php: Fix charset header of exported HTML/XLS file (bug #1541100). diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index 4cf9fc9bb..ca98e2baf 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -1512,7 +1512,12 @@ if ( ! defined( 'PMA_MINIMUM_COMMON' ) ) { $group_by_clause .= $arr[$i]['data'] . $sep; } if ($in_order_by && $upper_data != 'ORDER' && $upper_data != 'BY') { - $order_by_clause .= $arr[$i]['data'] . $sep; + // add a space only before ASC or DESC + // not around the dot between dbname and tablename + if ($arr[$i]['type'] == 'alpha_reservedWord') { + $order_by_clause .= $sep; + } + $order_by_clause .= $arr[$i]['data']; } if ($in_having && $upper_data != 'HAVING') { $having_clause .= $arr[$i]['data'] . $sep;