diff --git a/CHANGELOG.md b/CHANGELOG.md index e6789f3e..9533b2bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Adminer dev - Export: Fix tar (regression from 5.0.3) +- Select: Allow ordering by COUNT(*) (bug #966, regression from 5.0.2) - Optimize retrieving columns for schema - Elasticsearch: Make it work with Elasticsearch 8 - CSS: Hide menu on mobile diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 0fbe7ba4..1324f61e 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -350,9 +350,9 @@ if (!$columns && support("table")) { $column = idf_escape($key); $href = remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key); $desc = "&desc%5B0%5D=1"; - $sortable = isset($field["privileges"]["order"]); echo "" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", ""); $fun = apply_sql_function($val["fun"], $name); //! columns looking like functions + $sortable = isset($field["privileges"]["order"]) || $fun; echo ($sortable ? '' . "$fun" : $fun); // $order[0] == $key - COUNT(*) echo "