]> git.joonet.de Git - adminer.git/commitdiff
MariaDB: Display MariaDB instead of MySQL
authorJakub Vrana <jakub@vrana.cz>
Sun, 16 Mar 2025 16:39:11 +0000 (17:39 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 16 Mar 2025 17:02:34 +0000 (18:02 +0100)
adminer/drivers/mysql.inc.php
changes.txt

index 91c07414b3ebdff57a05b8e8d34f24f98073511d..a3c23f1efe2872ecf9a778e70711409ce1a8c738 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace Adminer;
 
-$drivers = array("server" => "MySQL") + $drivers;
+$drivers = array("server" => "MySQL / MariaDB") + $drivers;
 
 if (!defined('Adminer\DRIVER')) {
        define('Adminer\DRIVER', "server"); // server - backwards compatibility
@@ -435,11 +435,13 @@ if (!defined('Adminer\DRIVER')) {
        * @return mixed Db or string for error
        */
        function connect($credentials) {
+               global $drivers;
                $connection = new Db;
                if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
-                       $connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5
+                       $connection->set_charset(charset($connection));
                        $connection->query("SET sql_quote_show_create = 1, autocommit = 1");
                        $connection->maria = preg_match('~MariaDB~', $connection->server_info);
+                       $drivers["server"] = ($connection->maria ? "MariaDB" : "MySQL");
                        return $connection;
                }
                $return = $connection->error;
index a6bf14c2eb59dab3142c6ef4610995333cf60e14..c8eea2db85e4cb6138edc9d3bd9deed6e090a7d8 100644 (file)
@@ -2,6 +2,7 @@ Adminer dev:
 Align numbers right (bug #912)
 Remember export setting at SQL command
 SQL textarea: Open help on Ctrl+click
+MariaDB: Display MariaDB instead of MySQL
 CSS: Dark mode syntax highlighting
 Designs named adminer-dark.css use dark basic style
 Plugins: Add method syntaxHighlighting()