From 8c985124f2e9dab7b26a8f356f3f006107eb9c9b Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 24 Jun 2014 14:59:19 +0200 Subject: [PATCH] MySQL: Use utf8mb4 if available --- adminer/drivers/mysql.inc.php | 4 +++- changes.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 8778bde7..def95e3b 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -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; } diff --git a/changes.txt b/changes.txt index 6680d5ae..50b8f46f 100644 --- a/changes.txt +++ b/changes.txt @@ -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