]> git.joonet.de Git - adminer.git/commitdiff
Link to EXPLAIN output
authorJakub Vrana <jakub@vrana.cz>
Fri, 10 Dec 2010 16:54:57 +0000 (17:54 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 10 Dec 2010 16:54:57 +0000 (17:54 +0100)
adminer/include/editing.inc.php
adminer/sql.inc.php

index d4a10e17adeddb47255c2fb4aec52c2a30523496..d51e5ed6db81c1a948a990096b47457cd3026923 100644 (file)
@@ -4,7 +4,7 @@
 * @param Min_DB connection to examine indexes
 * @return null
 */
-function select($result, $connection2 = null) {
+function select($result, $connection2 = null, $href = "") {
        $links = array(); // colno => orgtable - create links from these columns
        $indexes = array(); // orgtable => array(column => colno) - primary keys
        $columns = array(); // orgtable => array(column => ) - not selected columns in primary key
@@ -41,7 +41,8 @@ function select($result, $connection2 = null) {
                                        $blobs[$j] = true;
                                }
                                $types[$j] = $field->type;
-                               echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($field->name);
+                               $name = h($field->name);
+                               echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . ($href ? "<a href='$href" . strtolower($name) . "' target='_blank'>$name</a>" : $name);
                        }
                        echo "</thead>\n";
                }
index b5eebb492e5f993ae6074dae5581843cbb7bd71b..299c2cca52e89440220b5a775bdefbb87e0a6ec6 100644 (file)
@@ -106,7 +106,7 @@ if (!$error && $_POST) {
                                                                                $id = "explain-$commands";
                                                                                echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>\n";
                                                                                echo "<div id='$id' class='hidden'>\n";
-                                                                               select($explain);
+                                                                               select($explain, $connection2, ($jush == "sql" ? "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/explain-output.html#" : ""));
                                                                                echo "</div>\n";
                                                                        }
                                                                }