diff --git a/ChangeLog b/ChangeLog index d7bbb1a68f..7bfc0aa3fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -74,6 +74,7 @@ explanation 4.3.13.0 (not yet released) - bug #4803 "Show hidden items" is sometimes hidden +- bug #4807 Breaks when sorting by multiple columns while using UNION 4.3.12.0 (2015-03-14) - bug #4746 Right-aligned columns have left-aligned header diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index cc3f382847..769bf2d483 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -1981,7 +1981,10 @@ class PMA_DisplayResults if (/*overload*/mb_strpos($name_to_use_in_sort, '(') !== false) { $sort_order .= $query_head . $name_to_use_in_sort . ' ' ; } else { - $sort_order .= $query_head . $sort_tbl_new . "." + if (/*overload*/mb_strlen($sort_tbl_new) > 0) { + $sort_tbl_new .= "."; + } + $sort_order .= $query_head . $sort_tbl_new . PMA_Util::backquote( $name_to_use_in_sort ) . ' ' ;