The branch, master has been updated via d6f12a7044f4e9ca1faaae496dddb00fc36792ea (commit) via 21bf7ce3815d691ff42ce0ec7784a262fdaa95cf (commit) from 5b62968f47093deea0576eaf4c7c0d1d1b081a62 (commit)
- Log ----------------------------------------------------------------- commit d6f12a7044f4e9ca1faaae496dddb00fc36792ea Author: Madhura Jayaratne madhura.cj@gmail.com Date: Sun Dec 18 10:58:25 2011 +0530
but #3461750 [edit] Sort by key generates wrong sql with limit clause
commit 21bf7ce3815d691ff42ce0ec7784a262fdaa95cf Author: Madhura Jayaratne madhura.cj@gmail.com Date: Sun Dec 18 08:38:45 2011 +0530
bug #3299486 [prettyprint] Order By in a query containing comment character - part2 - sort by fey
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + libraries/display_tbl.lib.php | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 62883ec..9c73227 100644 --- a/ChangeLog +++ b/ChangeLog @@ -64,6 +64,7 @@ phpMyAdmin - ChangeLog - bug #3408377 [interface] Deleting table from the DB does not change the table counter + rfe #3438266 [designer] Toggle for relation lines - bug #3442069 [AJAX] database list not updated after adding/deleting a user + database +- but #3461750 [edit] Sort by key generates wrong sql with limit clause
3.4.10.0 (not yet released) - bug #3460090 [interface] TextareaAutoSelect feature broken diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 5b39565..48ac01a 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -551,13 +551,20 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ $asc_sort = '`' . implode('` ASC, `', array_keys($index->getColumns())) . '` ASC'; $desc_sort = '`' . implode('` DESC, `', array_keys($index->getColumns())) . '` DESC'; $used_index = $used_index || $local_order == $asc_sort || $local_order == $desc_sort; + if (preg_match('@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))@is', $unsorted_sql_query, $my_reg)) { + $unsorted_sql_query_first_part = $my_reg[1]; + $unsorted_sql_query_second_part = $my_reg[2]; + } else { + $unsorted_sql_query_first_part = $unsorted_sql_query; + $unsorted_sql_query_second_part = ''; + } echo '<option value="' - . htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $asc_sort) + . htmlspecialchars($unsorted_sql_query_first_part . "\n" . ' ORDER BY ' . $asc_sort . $unsorted_sql_query_second_part) . '"' . ($local_order == $asc_sort ? ' selected="selected"' : '') . '>' . htmlspecialchars($index->getName()) . ' (' . __('Ascending') . ')</option>'; echo '<option value="' - . htmlspecialchars($unsorted_sql_query . ' ORDER BY ' . $desc_sort) + . htmlspecialchars($unsorted_sql_query_first_part . "\n" . ' ORDER BY ' . $desc_sort . $unsorted_sql_query_second_part) . '"' . ($local_order == $desc_sort ? ' selected="selected"' : '') . '>' . htmlspecialchars($index->getName()) . ' (' . __('Descending') . ')</option>';
hooks/post-receive