From 452b9ad7f17909c123dbaa422bf3731e38714c6e Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 24 Jan 2018 09:18:19 +0100 Subject: [PATCH] MariaDB: Support fulltext and spatial indexes in InnoDB (bug #583) --- adminer/indexes.inc.php | 12 ++++++++++-- changes.txt | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php index 0b43ee3e..a430b9a9 100644 --- a/adminer/indexes.inc.php +++ b/adminer/indexes.inc.php @@ -2,10 +2,18 @@ $TABLE = $_GET["indexes"]; $index_types = array("PRIMARY", "UNIQUE", "INDEX"); $table_status = table_status($TABLE, true); -if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.6 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { +$server_info = $connection->server_info; +$fulltext = ($server_info >= 5.6); +$spatial = ($server_info >= 5.7); +if (preg_match('~([\d.]+)-MariaDB~', $server_info, $match)) { + $server_info = $match[1]; + $fulltext = (version_compare($server_info, '10.0.5') >= 0); + $spatial = (version_compare($server_info, '10.2.2') >= 0); +} +if (preg_match('~MyISAM|M?aria' . ($fulltext ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { $index_types[] = "FULLTEXT"; } -if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.7 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { +if (preg_match('~MyISAM|M?aria' . ($spatial ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { $index_types[] = "SPATIAL"; } $indexes = indexes($TABLE); diff --git a/changes.txt b/changes.txt index 277dc119..8093f5a8 100644 --- a/changes.txt +++ b/changes.txt @@ -5,6 +5,7 @@ Hide window.opener from pages opened in a new window (bug #561) Adminer: Fix Search data in tables (regression from 4.4.0) CSP: Allow any styles, images, media and fonts, disallow base-uri MySQL: Support geometry in MySQL 8 (bug #574) +MariaDB: Support fulltext and spatial indexes in InnoDB (bug #583) SQLite: Enable foreign key checks PostgreSQL: Respect NULL default value PostgreSQL: Display foreign tables (bug #576)