Bug #778 chsize() used in my_chsize does not support __int64
Submitted: 2 Jul 2003 7:27 Modified: 13 Aug 2003 12:50
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:3.23.57 OS:Windows (Win2000 NTFS)
Assigned to: Bugs System CPU Architecture:Any

[2 Jul 2003 7:27] [ name withheld ]
Description:
Running MySQL Distrib 3.23.54 on i32. This is where I see the error:

E:\mysql\data\test>myisamchk -O key_buffer=512M -O sort_buffer=512M -O read_buffer=64M -O write_buffer=64M -r -S -a rsecpossqs
- recovering (with keycache) MyISAM-table 'rsecpossqs.MYI'
Data records: 54822847
myisamchk: warning: Can't change size of indexfile, error: 22
myisamchk: error: 22 for record at pos 4294967232
MyISAM-table 'rsecpossqs' is not fixed because of errors
Try fixing it by using the --safe-recover (-o) or the --force (-f) option

And this is about 4 hours after starting the command; right after myisamchk runs through counting up the rows.

The table is the standard size, no adjustments have been made to the AVG_ROW_LENGTH and MAX_ROWS yet. File sizes are:

4,294,967,268 rsecpossqs.MYD
4,383,221,760 rsecpossqs.MYI

at the moment. Should be cut in half after the optimize because of deletes. Will be looking at merge tables later, but I need this working in the mean-time. 

Output from myisamchk -dv rsecpossqs.myi

--------------------------------------------------------------------------------
MyISAM file:         rsecpossqs.myi
Record format:       Packed
Character set:       latin1 (8)
File-version:        1
Creation time:       2002-10-18 22:39:44
Recover time:        2002-10-19 23:38:27
Status:              changed
Data records:             54822847  Deleted blocks:          40358029
Datafile parts:           95419877  Deleted data:          1772432408
Datafile pointer (bytes):        4  Keyfile pointer (bytes):        4
Datafile length:        4294967268  Keyfile length:        4383221760
Max datafile length:    4294967294  Max keyfile length: 4398046510079
Recordlength:                  101

table description:
Key Start Len Index   Type                     Rec/key         Root  Blocksize
1   2     4   multip. long                           0   1628417024       1024
2   99    3   multip. uint24                         0   2517115904       1024
3   95    4   multip. long                           0   2130399232       1024
4   31    64  multip. char packed stripped           0   1526540288       1024
5   14    16  multip. char packed stripped           0   1576935424       1024
--------------------------------------------------------------------------------

How to repeat:
Create a large table with indexes that will exceed the 4Gb size (32bit unsigned int).  Run myisamchk -r -S -a against the table.

Suggested fix:
Patch config-win.h:
Line 232:
-#define HAVE_CHSIZE        /* System has chsize() function */
+#undef HAVE_CHSIZE        /* System has chsize() function but is only 32 bit*/
[13 Aug 2003 12:50] Vasily Kishkin
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