From 2d8046d94e0ab8990a6a6df59e659125c0fecccb Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 16 Dec 2007 15:57:09 +0000 Subject: [PATCH] bug #1851833 [display] Sorting forgets an explicit LIMIT (fix for sorting on column headers) --- ChangeLog | 2 ++ libraries/sqlparser.lib.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 17d429ab2..9bfd342ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1817612 [cookies] Wrong cookie path on IIS with PHP-CGI, thanks to Carsten Wiedmann - bug #1848889 [export] export trigger should use DROP TRIGGER IF EXISTS +- bug #1851833 [display] Sorting forgets an explicit LIMIT + (fix for sorting on column headers) 2.11.3.0 (2007-12-08) - patch #1818389 to remove a notice (failed to flush buffer), thanks to diff --git a/libraries/sqlparser.lib.php b/libraries/sqlparser.lib.php index de6d309cb..d6cb032d4 100644 --- a/libraries/sqlparser.lib.php +++ b/libraries/sqlparser.lib.php @@ -1495,6 +1495,7 @@ if (! defined('PMA_MINIMUM_COMMON')) { $in_limit = TRUE; $limit_clause = ''; $before_limit = FALSE; + $in_order_by = FALSE; // @todo maybe others to set FALSE } if ($upper_data == 'PROCEDURE') { @@ -1676,7 +1677,8 @@ if (! defined('PMA_MINIMUM_COMMON')) { if (isset($subresult['queryflags']['select_from']) && $subresult['queryflags']['select_from'] == 1 - && !$seen_order) { + && ! $in_order_by + && $upper_data != 'ORDER') { $unsorted_query .= $arr[$i]['data']; if ($arr[$i]['type'] != 'punct_bracket_open_round'