diff --git a/adminer/database.inc.php b/adminer/database.inc.php
index 5346e46c..80fc7cb1 100644
--- a/adminer/database.inc.php
+++ b/adminer/database.inc.php
@@ -63,6 +63,7 @@ echo ($_POST["add_x"] || strpos($name, "\n")
: ''
) . "\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'));");
diff --git a/adminer/db.inc.php b/adminer/db.inc.php
index d2215629..38d5cbcc 100644
--- a/adminer/db.inc.php
+++ b/adminer/db.inc.php
@@ -72,11 +72,11 @@ if ($adminer->homepage()) {
echo '
' . script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
echo ' | ' . lang('Table');
echo ' | ' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
- echo ' | ' . lang('Collation') . doc_link(array('sql' => 'charset-mysql.html'));
+ echo ' | ' . lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/'));
echo ' | ' . lang('Data Length') . $doc_link;
echo ' | ' . lang('Index Length') . $doc_link;
echo ' | ' . lang('Data Free') . $doc_link;
- echo ' | ' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html'));
+ echo ' | ' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/'));
echo ' | ' . lang('Rows') . $doc_link;
echo (support("comment") ? ' | ' . lang('Comment') . $doc_link : '');
echo "\n";
diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php
index 6eadf94e..68d0f718 100644
--- a/adminer/drivers/mysql.inc.php
+++ b/adminer/drivers/mysql.inc.php
@@ -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
}
}
diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php
index 47c623f6..c87728e6 100644
--- a/adminer/foreign.inc.php
+++ b/adminer/foreign.inc.php
@@ -78,6 +78,7 @@ foreach ($row["source"] as $key => $val) {
: "") + explode("|", $on_actions), $row["on_update"]); ?>
"innodb-foreign-key-constraints.html",
+ 'mariadb' => "foreign-keys/",
'pgsql' => "sql-createtable.html#SQL-CREATETABLE-REFERENCES",
'mssql' => "ms174979.aspx",
'oracle' => "clauses002.htm#sthref2903",
diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php
index 4a4e0bcb..022b4bc1 100644
--- a/adminer/include/editing.inc.php
+++ b/adminer/include/editing.inc.php
@@ -50,7 +50,10 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
}
$types[$j] = $field->type;
echo " | 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 "\n";
@@ -244,6 +247,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
| NULL
| AI "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 = "?") {
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 = "?") {
'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] ? "$text" : "");
}
diff --git a/changes.txt b/changes.txt
index 3348bbdd..3b6eb249 100644
--- a/changes.txt
+++ b/changes.txt
@@ -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)
|