diff --git a/ChangeLog b/ChangeLog index 52860b0300..3cf0c4859f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ phpMyAdmin - ChangeLog - bug #4625 "Insufficient space to save the file" on export SQL to file on server - bug #4627 "file_get_contents(examples/create_tables.sql): failed to open stream" after update - bug #4617 UI issues with sortable tables +- bug #4619 SELECT LENGTH(`field`) FROM `table` does not sort 4.3.0.0 (2014-12-05) + rfe #1502 Smart sorting for int keys diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index b7c0d84221..3004974bc3 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -1975,6 +1975,7 @@ class PMA_DisplayResults } $sort_expression_nodirection = array_filter($sort_expression_nodirection); + $single_sort_order = null; foreach ($sort_expression_nodirection as $index=>$expression) { // check if this is the first clause, // if it is then we have to add "order by" @@ -1995,7 +1996,8 @@ class PMA_DisplayResults // formatting of function expressions like "COUNT(name )" // so we remove the space in this situation $name_to_use_in_sort = str_replace(' )', ')', $name_to_use_in_sort); - $name_to_use_in_sort = str_replace('`', '', $name_to_use_in_sort); + $name_to_use_in_sort = str_replace('``', '`', $name_to_use_in_sort); + $name_to_use_in_sort = trim($name_to_use_in_sort, '`'); // If this the first column name in the order by clause add // order by clause to the column name