]> git.joonet.de Git - adminer.git/commitdiff
MariaDB: Links to documentation
authorJakub Vrana <jakub@vrana.cz>
Thu, 8 Feb 2018 12:56:22 +0000 (13:56 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 8 Feb 2018 12:56:22 +0000 (13:56 +0100)
adminer/database.inc.php
adminer/db.inc.php
adminer/drivers/mysql.inc.php
adminer/foreign.inc.php
adminer/include/editing.inc.php
changes.txt

index 5346e46c4e93b1912e15155558728efb4f1afb56..80fc7cb14aad5ff914a67f9aef8ae4373d5adc82 100644 (file)
@@ -63,6 +63,7 @@ echo ($_POST["add_x"] || strpos($name, "\n")
        : '<input name="name" id="name" value="' . h($name) . '" maxlength="64" autocapitalize="off">'
 ) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) . doc_link(array(
        'sql' => "charset-charsets.html",
+       'mariadb' => "supported-character-sets-and-collations/",
        'mssql' => "ms187963.aspx",
 )) : "");
 echo script("focus(qs('#name'));");
index d2215629ccd8a5f184192974fa91f3d6c82fc611..38d5cbccef86b7197fffa9170ee43be155e6785c 100644 (file)
@@ -72,11 +72,11 @@ if ($adminer->homepage()) {
                        echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
                        echo '<th>' . lang('Table');
                        echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
-                       echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-mysql.html'));
+                       echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/'));
                        echo '<td>' . lang('Data Length') . $doc_link;
                        echo '<td>' . lang('Index Length') . $doc_link;
                        echo '<td>' . lang('Data Free') . $doc_link;
-                       echo '<td>' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html'));
+                       echo '<td>' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/'));
                        echo '<td>' . lang('Rows') . $doc_link;
                        echo (support("comment") ? '<td>' . lang('Comment') . $doc_link : '');
                        echo "</thead>\n";
index 6eadf94e3fc21fd323a67b32d8a6b22e70f6e901..68d0f71895e64ac3a3a55b7f690eeeab2339a383 100644 (file)
@@ -315,11 +315,12 @@ if (!defined("DRIVER")) {
                }
 
                function tableHelp($name) {
+                       $maria = preg_match('~MariaDB~', $this->_conn->server_info);
                        if (information_schema(DB)) {
-                               return strtolower(str_replace("_", "-", $name)) . "-table.html";
+                               return strtolower(($maria ? "information-schema-$name-table/" : str_replace("_", "-", $name) . "-table.html"));
                        }
                        if (DB == "mysql") {
-                               return "system-database.html"; //! more precise link
+                               return ($maria ? "mysql$name-table/" : "system-database.html"); //! more precise link
                        }
                }
 
index 47c623f617119e93e73bd939c8067c24fb30e286..c87728e660770f83de67129e9175e50e815d3d5f 100644 (file)
@@ -78,6 +78,7 @@ foreach ($row["source"] as $key => $val) {
  <?php echo lang('ON UPDATE'); ?>: <?php echo html_select("on_update", array(-1 => "") + explode("|", $on_actions), $row["on_update"]); ?>
 <?php echo doc_link(array(
        'sql' => "innodb-foreign-key-constraints.html",
+       'mariadb' => "foreign-keys/",
        'pgsql' => "sql-createtable.html#SQL-CREATETABLE-REFERENCES",
        'mssql' => "ms174979.aspx",
        'oracle' => "clauses002.htm#sthref2903",
index 4a4e0bcb46a99d82d06af86e1601d41501540994..022b4bc12b6ed6e52fdae39d596fdcea2880ac9e 100644 (file)
@@ -50,7 +50,10 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
                                }
                                $types[$j] = $field->type;
                                echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($name)
-                                       . ($orgtables ? doc_link(array('sql' => "explain-output.html#explain_" . strtolower($name))) : "")
+                                       . ($orgtables ? doc_link(array(
+                                               'sql' => "explain-output.html#explain_" . strtolower($name),
+                                               'mariadb' => "explain/#the-columns-in-explain-select",
+                                       )) : "")
                                ;
                        }
                        echo "</thead>\n";
@@ -244,6 +247,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
 <td id="label-null">NULL
 <td><input type="radio" name="auto_increment_col" value=""><acronym id="label-ai" title="<?php echo lang('Auto Increment'); ?>">AI</acronym><?php echo doc_link(array(
        'sql' => "example-auto-increment.html",
+       'mariadb' => "auto_increment/",
        'sqlite' => "autoinc.html",
        'pgsql' => "datatype.html#DATATYPE-SERIAL",
        'mssql' => "ms186775.aspx",
@@ -488,7 +492,8 @@ function ini_bytes($ini) {
 */
 function doc_link($paths, $text = "<sup>?</sup>") {
        global $jush, $connection;
-       $version = preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $connection->server_info);
+       $server_info = $connection->server_info;
+       $version = preg_replace('~^(\\d\\.?\\d).*~s', '\\1', $server_info); // two most significant digits
        $urls = array(
                'sql' => "https://dev.mysql.com/doc/refman/$version/en/",
                'sqlite' => "https://www.sqlite.org/",
@@ -496,6 +501,10 @@ function doc_link($paths, $text = "<sup>?</sup>") {
                'mssql' => "https://msdn.microsoft.com/library/",
                'oracle' => "https://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
        );
+       if (preg_match('~MariaDB~', $server_info)) {
+               $urls['sql'] = "https://mariadb.com/kb/en/library/";
+               $paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql']));
+       }
        return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]'" . target_blank() . ">$text</a>" : "");
 }
 
index 3348bbdd3344412c4f233a8c8c9bcdd45c806112..3b6eb249d8895976cf7b6a3f4e17203f5c89bfc0 100644 (file)
@@ -4,6 +4,7 @@ Sticky position of table actions
 Add system tables help links
 MySQL: Support non-utf8 charset in search in column
 MySQL: Support geometry in MySQL 8 (bug #574)
+MariaDB: Links to documentation
 SQLite: Allow deleting PRIMARY KEY from tables with auto increment
 PostgreSQL: Support binary files in bytea fields
 PostgreSQL: Don't treat interval type as number (bug #474)