]> git.joonet.de Git - adminer.git/commitdiff
non-MySQL: Fix computing unique array
authorJakub Vrana <jakub@vrana.cz>
Thu, 17 Apr 2025 16:07:23 +0000 (18:07 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 17 Apr 2025 16:07:23 +0000 (18:07 +0200)
adminer/select.inc.php

index 5844f4429efaabca9b96d10e06ae46cf6bd35d4c..267c95e6cd97ce9f59f7a283535b23df9a811ed8 100644 (file)
@@ -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 = "";