Bug #45217 Using myisamchk --unpack results in small myisam_data_pointer_size
Submitted: 31 May 2009 14:25 Modified: 31 May 2009 14:27
Reporter: Harrison Fisk Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.1.32 OS:Any
Assigned to: CPU Architecture:Any

[31 May 2009 14:25] Harrison Fisk
Description:
myisamchk --unpack will recreate the table and use a small pointer size.  This can cause issues when you subsequently try to add a lot of data to the table.

You then need to run an ALTER TABLE .. MAX_ROWS to enlarge the pointer size. 

It would be nice to have it either restore the old pointer size (which I don't think is really possible), or to be able to specify the pointer size to use in the unpack operation.

How to repeat:
-- create table
CREATE TABLE packed (a varchar(1000)) ENGINE=myisam;

-- populate it
insert into packed values (repeat('a', 100)), (repeat('b', 100)), (repeat('c', 100)),(repeat('d', 100)),(repeat('e', 100)),(repeat('f', 100)),(repeat('g', 100)),(repeat('h', 100)),(repeat('i', 100)),(repeat('j', 100));

-- look at max_data_length prior to packing/unpacking
SHOW TABLE STATUS LIKE 'packed'\G

-- pack with myisampack
myisampack packed

-- unpack with myisamchk
myisamchk -u packed

-- flush tables and view max_data_length again
FLUSH TABLES;
SHOW TABLE STATUS LIKE 'packed'\G

Suggested fix:
Add an option to specify the size of the table to use (or myisam_data_pointer_size).
[14 Nov 2014 6:54] MySQL Verification Team
See also Bug #74804 about unpacking MyISAM table.