Bug #4785 myisampack with fulltext index leads to error 136
Submitted: 28 Jul 2004 13:17 Modified: 23 Sep 2004 9:00
Reporter: Aleksey Kishkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:4.0.21 OS:Any (all)
Assigned to: Sergey Petrunya CPU Architecture:Any

[28 Jul 2004 13:17] Aleksey Kishkin
Description:
Capacity of index file depends on size of inner pointer in index file. 

When one packs table, myisampack tries to use the minimal possible pointer size and it knows number of rows in advance, so it can chose the correct value. But for fulltext index number of index entries can be much larger than number of rows, so the estimation becomes wrong.

If the table contains a few records but uses fulltext index, after packing, myisamchk -rq fails with error 136 - no room in index file

How to repeat:
I'll submit a testcase - (bug.pl), that generates a table (bug_table), fills it. After creating and filling it , one must run myisampack bug_table and myisamchk -rq bug_table

bash-2.05b# ./bug.pl
Connecting
Inserting

bash-2.05b# bin/myisampack var/test/bug_test
Compressing var/test/bug_test.MYD: (800 records)
- Calculating statistics
- Compressing file
41.13%
Remember to run myisamchk -rq on compressed tables

bash-2.05b# bin/myisamchk -rq  var/test/bug_test
- check record delete-chain
- recovering (with sort) MyISAM-table 'var/test/bug_test'
Data records: 800
- Fixing index 1
- Fixing index 2
myisamchk: error: 136 when fixing table
MyISAM-table 'var/test/bug_test' is not fixed because of errors
Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag
[28 Jul 2004 13:18] Aleksey Kishkin
perl script for preparing table

Attachment: bug.pl (text/x-perl), 751 bytes.

[22 Sep 2004 12:30] Sergey Petrunya
ChangeSet@1.2021, 2004-09-22 16:29:15+04:00, sergefp@mysql.com
[23 Sep 2004 9:00] Sergey Petrunya
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