1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 17:44:07 +02:00

MySQL: Support JSON data type

This commit is contained in:
Jakub Vrana
2017-03-10 08:15:52 +01:00
parent 50390ea38c
commit b616c57352
2 changed files with 6 additions and 1 deletions

View 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;