Bug #24006 Documentation inconsistent WRT Spatial index support for InnoDB
Submitted: 6 Nov 2006 12:32 Modified: 29 Nov 2006 17:43
Reporter: Anders Karlsson Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.1.12/5.0 OS:Windows (Windows/Linux)
Assigned to: MC Brown CPU Architecture:Any

[6 Nov 2006 12:32] Anders Karlsson
The 5.1 manual implies that creating a SPATIAL INDEX on InnoDB is valid, but will really create a B-TREE Index, although the statement is a fair bit unclear on the matter:

Another place in the manual implies that SPATIAL INDEX really can be created using InnoDB, but that this may cause a crash:

Fact is, none of this is true. You cannot create a spatial index on an InnoDB table.

These are partly covered by bugs #18929 (which caused the crash warning mentioned above) and #23536

How to repeat:
mysql> create table t2(c1 POINT, SPATIAL INDEX(c1));
ERROR 1464 (HY000): The used table type doesn't support SPATIAL indexes

Suggested fix:
There are three options:
- Let the code stay as it is, and fix the documentation.
- Follow the idea of the first referenced part of the documentation and create a B-TREE index on a SPATIAL column when using InnoDB.
- Implement R-TREE indexes for InnoDB.
[6 Nov 2006 12:50] MySQL Verification Team
Thank you for the bug report.

mysql> create table t2(c1 POINT, SPATIAL INDEX(c1)) engine=innodb;
ERROR 1464 (HY000): The used table type doesn't support SPATIAL indexes
mysql> select version();
| version()      |
| 5.1.13-beta-nt |
1 row in set (0.00 sec)

[29 Nov 2006 17:43] MC Brown
The documentation has been updated with a warning that spatial indexes are not supported for the InnoDB, Archive and NDB engines.