Bug #10839 myisamchk segfaults on spatial index
Submitted: 24 May 2005 19:36 Modified: 27 Jul 2005 7:44
Reporter: Jean-Paul Le Fèvre Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:5.0.4-beta OS:Linux (Linux)
Assigned to: Alexey Botchkov CPU Architecture:Any

[24 May 2005 19:36] Jean-Paul Le Fèvre
Description:
After having compressed a table which has a geometry column and a spatial index on it
the command myisamchk crashes with Segmentation fault.
The same occurs when running myisamchk -rq after myisamchk --keys-used=0

How to repeat:
drop table if exists events;
create table events (
id           bigint not null primary key auto_increment,
   event_number int, run_number   int,
   time         bigint, energy       float, quality      float,
   position     point  not null
);

insert events .... 
create spatial index position_index on events(position);

mysqladmin -u root -p shutdown
myisampack -b data/glast_ds/events

myisamchk -rq data/glast_ds/events
[24 May 2005 19:37] Jean-Paul Le Fèvre
data

Attachment: events.MYD (application/octet-stream, text), 3.32 KiB.

[24 May 2005 19:38] Jean-Paul Le Fèvre
index

Attachment: events.MYI (application/octet-stream, text), 1024 bytes.

[24 May 2005 19:38] Jean-Paul Le Fèvre
frm

Attachment: events.frm (application/octet-stream, text), 8.58 KiB.

[25 May 2005 19:25] MySQL Verification Team
Verified on Slackware 10.0

miguel@hegel:~/dbs/5.0$ bin/myisampack -b var/db4/events
Compressing var/db4/events.MYD: (665 records)
- Calculating statistics
- Compressing file
84.33%     
Remember to run myisamchk -rq on compressed tables
miguel@hegel:~/dbs/5.0$ bin/myisamchk -rq var/db4/events
- check record delete-chain
- recovering (with keycache) MyISAM-table 'var/db4/events'
Data records: 665
Segmentation fault
miguel@hegel:~/dbs/5.0$
[20 Jul 2005 9:47] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/27355
[20 Jul 2005 23:00] Jean-Paul Le Fèvre
I've added the correction in mi_create.c from the latest release 5.0.9-beta-log.

At this point myisamchk -rq events works as expected.

The bug seems to be fixed.

Thank you !
[27 Jul 2005 7:44] 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
    http://www.mysql.com/doc/en/Installing_source_tree.html