]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Use utf8mb4 if available
authorJakub Vrana <jakub@vrana.cz>
Tue, 24 Jun 2014 12:59:19 +0000 (14:59 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 24 Jun 2014 12:59:19 +0000 (14:59 +0200)
adminer/drivers/mysql.inc.php
changes.txt

index 8778bde71d296f17367e19f00103a580e3c9a9be..def95e3b54b0fb1b2390fcdb90c58ed6b0d56d62 100644 (file)
@@ -292,7 +292,9 @@ if (!defined("DRIVER")) {
                $connection = new Min_DB;
                $credentials = $adminer->credentials();
                if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
-                       $connection->set_charset("utf8"); // available in MySQLi since PHP 5.0.5
+                       $connection->set_charset( // available in MySQLi since PHP 5.0.5
+                               version_compare($connection->server_info, "5.5.3") > 0 ? "utf8mb4" : "utf8" // SHOW CHARSET would require an extra query
+                       );
                        $connection->query("SET sql_quote_show_create = 1, autocommit = 1");
                        return $connection;
                }
index 6680d5aea641284abaccedd9febb60e62446036f..50b8f46fe4e4111abae1a73f01ad8c958e867ea7 100644 (file)
@@ -1,5 +1,6 @@
 Adminer 4.1.1-dev:
 Fix reading routine column collations
+MySQL: Use utf8mb4 if available
 
 Adminer 4.1.0 (released 2014-04-18)
 Provide size of all databases in the overview