]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Hide index algorithm if only one
authorJakub Vrana <jakub@vrana.cz>
Fri, 18 Apr 2025 12:58:41 +0000 (14:58 +0200)
committerJakub Vrana <jakub@vrana.cz>
Fri, 18 Apr 2025 12:58:41 +0000 (14:58 +0200)
adminer/include/adminer.inc.php
adminer/indexes.inc.php

index eb0338aba83729bf5251f33b4b0f8f56bce11236..9bd7277c8a794c294bd10a1341c8acdd736f902f 100644 (file)
@@ -368,7 +368,7 @@ class Adminer {
                        }
 
                        echo "<tr title='" . h($name) . "'>";
-                       echo "<th>$index[type]" . ($index['algorithm'] != $default_algorithm ? " ($index[algorithm])" : "");
+                       echo "<th>$index[type]" . ($default_algorithm && $index['algorithm'] != $default_algorithm ? " ($index[algorithm])" : "");
                        echo "<td>" . implode(", ", $print);
                        echo "\n";
                }
index c027d910659b4186676d957c04d59fab32f0e560..1676e6032d1ecc625fc496b3f6e74dd0d0049310 100644 (file)
@@ -54,7 +54,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
                                        && array_values($existing["columns"]) === $columns
                                        && (!$existing["lengths"] || array_values($existing["lengths"]) === $lengths)
                                        && array_values($existing["descs"]) === $descs
-                                       && $existing["algorithm"] === $index_algorithm
+                                       && (!$index_algorithms || $existing["algorithm"] == $index_algorithm)
                                ) {
                                        // skip existing index
                                        unset($indexes[$name]);