From 0db17129a5124eac9065461f8d3192d7c5a9a8f9 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Thu, 26 May 2016 04:59:27 +0000 Subject: [PATCH] Database: Add support for `SPATIAL` keys to `dbDelta()`. `dbDelta()` already supported spatial fields (by virtue of not checking field types), so it's nice to round that out with spatial key support, too. Fixes #36948. Built from https://develop.svn.wordpress.org/trunk@37574 git-svn-id: http://core.svn.wordpress.org/trunk@37542 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 589d294b02..c025d81b76 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -2200,6 +2200,7 @@ function dbDelta( $queries = '', $execute = true ) { case 'fulltext': case 'unique': case 'key': + case 'spatial': $validfield = false; $indices[] = trim(trim($fld), ", \n"); break; @@ -2301,6 +2302,9 @@ function dbDelta( $queries = '', $execute = true ) { if ( 'FULLTEXT' === strtoupper( $index_data['index_type'] ) ) { $index_string .= 'FULLTEXT '; } + if ( 'SPATIAL' === strtoupper( $index_data['index_type'] ) ) { + $index_string .= 'SPATIAL '; + } $index_string .= 'KEY '; if ($index_name != 'PRIMARY') { $index_string .= $index_name; diff --git a/wp-includes/version.php b/wp-includes/version.php index 6d3d84b4b9..97a1f71a13 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37573'; +$wp_version = '4.6-alpha-37574'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.