Bug #2237 analyze table on spatial table with rtree makes table (or index) corrupt.
Submitted: 30 Dec 2003 8:04 Modified: 19 Feb 2004 5:13
Reporter: Wilko Quak Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:Linux (linux)
Assigned to: Alexey Botchkov CPU Architecture:Any

[30 Dec 2003 8:04] Wilko Quak
When calling analyze table on a table with an rtree, the table (or index) becomes corrupt. The analyze table gives the following message on the table with the index:

| Table             | Op      | Msg_type | Msg_text                           |
| test.test_polygon | analyze | error    | Key in wrong position at page 1024 |
| test.test_polygon | analyze | error    | Corrupt                            |

After that I cannot access the table anymore because all operations say:

ERROR 1016 at line 21: Can't open file: 'test_polygon.MYI'. (errno: 145)

How to repeat:
See attached script.

Suggested fix:
I've no idea. If you remove either one of the polygons from the testscript all goes well. Sometimes I have the idea that it depends on the number of points in the polygon.
[30 Dec 2003 8:05] Wilko Quak
Example script that generates the error.

Attachment: bug.sql (application/octet-stream, text), 538 bytes.

[30 Dec 2003 9:16] Dean Ellis
Verified against 4.1.2.

Thank you.
[19 Feb 2004 5:13] Alexey Botchkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at

Additional info:

bk commit - 4.1 tree (hf:1.1723) (19 Feb)