From: Jakub Vrana Date: Thu, 17 Apr 2025 16:07:23 +0000 (+0200) Subject: non-MySQL: Fix computing unique array X-Git-Tag: v5.3.0~24 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=0c5bba47dac06a700311eb64ad7cb34fc49a84ee;p=adminer.git non-MySQL: Fix computing unique array --- diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 5844f442..267c95e6 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -389,10 +389,12 @@ if (!$columns && support("table")) { $unique_array = unique_array($rows[$n], $indexes); if (!$unique_array) { $unique_array = array(); + reset($select); foreach ($rows[$n] as $key => $val) { - if (!preg_match('~^(COUNT\((\*|(DISTINCT )?`(?:[^`]|``)+`)\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\(`(?:[^`]|``)+`\))$~', $key)) { //! columns looking like functions + if (!preg_match('~^(COUNT|AVG|GROUP_CONCAT|MAX|MIN|SUM)\(~', current($select))) { $unique_array[$key] = $val; } + next($select); } } $unique_idf = "";