Steps to reproduce: Enable remember sort order feature and make PMA remember the sort order for a particular table. Browse the table and then edit the usual browse table query to add a limit clause. The added limit clause is ignored.
To be fixed in version 3.5.1
Proposed fix is diff --git a/libraries/common.lib.php b/libraries/common.lib.php index e35f405..f40f61b 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1120,6 +1120,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view ) { $query_base = $analyzed_display_query[0]['section_before_limit'] . "\n" . $GLOBALS['sql_order_to_append'] + . $analyzed_display_query[0]['limit_clause'] . ' ' . $analyzed_display_query[0]['section_after_limit'];
// Need to reparse query diff --git a/sql.php b/sql.php index 432fb14..952d7eb 100644 --- a/sql.php +++ b/sql.php @@ -467,7 +467,7 @@ if ($GLOBALS['cfg']['RememberSorting'] // retrieve the remembered sorting order for current table $sql_order_to_append = ' ORDER BY ' . $sorted_col . ' '; $full_sql_query = $analyzed_sql[0]['section_before_limit'] . $sql_order_to_append - . $analyzed_sql[0]['section_after_limit']; + . $analyzed_sql[0]['limit_clause'] . ' ' . $analyzed_sql[0]['section_after_limit'];
// update the $analyzed_sql $analyzed_sql[0]['section_before_limit'] .= $sql_order_to_append;
This bug was fixed in repository and will be part of a future release; thanks for reporting.
To be fixed in version 3.5.1
Proposed fix is
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index e35f405..f40f61b 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -1120,6 +1120,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
) {
$query_base = $analyzed_display_query[0]['section_before_limit']
. "\n" . $GLOBALS['sql_order_to_append']
+ . $analyzed_display_query[0]['limit_clause'] . ' '
. $analyzed_display_query[0]['section_after_limit'];
// Need to reparse query
diff --git a/sql.php b/sql.php
index 432fb14..952d7eb 100644
--- a/sql.php
+++ b/sql.php
@@ -467,7 +467,7 @@ if ($GLOBALS['cfg']['RememberSorting']
// retrieve the remembered sorting order for current table
$sql_order_to_append = ' ORDER BY ' . $sorted_col . ' ';
$full_sql_query = $analyzed_sql[0]['section_before_limit'] . $sql_order_to_append
- . $analyzed_sql[0]['section_after_limit'];
+ . $analyzed_sql[0]['limit_clause'] . ' ' . $analyzed_sql[0]['section_after_limit'];
// update the $analyzed_sql
$analyzed_sql[0]['section_before_limit'] .= $sql_order_to_append;
This bug was fixed in repository and will be part of a future release; thanks for reporting.