diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 806ca949..dcd57bbf 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -500,9 +500,9 @@ if (!defined("DRIVER")) { function indexes($table, $connection2 = null) { $return = array(); foreach (get_rows("SHOW INDEX FROM " . table($table), $connection2) as $row) { - $return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? "INDEX" : "UNIQUE"))); + $return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? ($row["Index_type"] == "SPATIAL" ? "SPATIAL" : "INDEX") : "UNIQUE"))); $return[$row["Key_name"]]["columns"][] = $row["Column_name"]; - $return[$row["Key_name"]]["lengths"][] = $row["Sub_part"]; + $return[$row["Key_name"]]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]); $return[$row["Key_name"]]["descs"][] = null; } return $return; diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php index ca69d5dd..806e1b6e 100644 --- a/adminer/indexes.inc.php +++ b/adminer/indexes.inc.php @@ -5,6 +5,9 @@ $table_status = table_status($TABLE, true); if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.6 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { $index_types[] = "FULLTEXT"; } +if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.7 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) { + $index_types[] = "SPATIAL"; +} $indexes = indexes($TABLE); $primary = array(); if ($jush == "mongo") { // doesn't support primary key diff --git a/changes.txt b/changes.txt index 5320d390..18ebbc60 100644 --- a/changes.txt +++ b/changes.txt @@ -3,6 +3,7 @@ Add accessibility labels Make maxlength in edit fields a soft limit Add Cache-Control: immutable to static files MySQL: Add dedicated view for replication status +MySQL: Support spatial indexes PostgreSQL: Export PostgreSQL: Don't treat partial indexes as unique MS SQL: Support pdo_dblib