]> git.joonet.de Git - adminer.git/commitdiff
MySQL: Support JSON data type
authorJakub Vrana <jakub@vrana.cz>
Fri, 10 Mar 2017 07:15:52 +0000 (08:15 +0100)
committerJakub Vrana <jakub@vrana.cz>
Fri, 10 Mar 2017 07:15:52 +0000 (08:15 +0100)
adminer/drivers/mysql.inc.php
changes.txt

index 62d16ed247a7f3cbb5cd409b9a3cfeec64564696..f38853aeb351ecc89075d42bbdc90ce112852e4b 100644 (file)
@@ -301,12 +301,16 @@ if (!defined("DRIVER")) {
        * @return mixed Min_DB or string for error
        */
        function connect() {
-               global $adminer;
+               global $adminer, $types, $structured_types;
                $connection = new Min_DB;
                $credentials = $adminer->credentials();
                if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
                        $connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5
                        $connection->query("SET sql_quote_show_create = 1, autocommit = 1");
+                       if (version_compare($connection->server_info, '5.7.8') >= 0) {
+                               $structured_types[lang('Strings')][] = "json";
+                               $types["json"] = 4294967295;
+                       }
                        return $connection;
                }
                $return = $connection->error;
index 24d6f320b099cdd725089fa9e162935d91dff695..d16c74ff12c2535a74dd12c15eb8a3f828f534be 100644 (file)
@@ -5,6 +5,7 @@ Add Cache-Control: immutable to static files
 MySQL: Add dedicated view for replication status
 MySQL: Support spatial indexes
 MySQL: Support MySQL 8
+MySQL: Support JSON data type
 PostgreSQL: Export
 PostgreSQL: Don't treat partial indexes as unique
 MS SQL: Support pdo_dblib