| Bug #26782 | Patch: myisamchk -rq creates .MYI.MYI file on packed MyISAM tables | ||
|---|---|---|---|
| Submitted: | 2 Mar 2007 5:01 | Modified: | 13 Apr 2007 20:12 |
| Reporter: | David Shrewsbury | ||
| Status: | Closed | ||
| Category: | Client | Severity: | S3 (Non-critical) |
| Version: | 5.1.17-BK | OS: | Linux (Linux) |
| Assigned to: | Ingo Strüwing | Target Version: | |
| Tags: | regression, qc, Contribution | ||
[2 Mar 2007 5:01]
David Shrewsbury
[2 Mar 2007 5:01]
David Shrewsbury
Patch for the mi_create.c file.
Attachment: mi_create.patch (application/octet-stream, text), 640 bytes.
[2 Mar 2007 7:30]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.1.17-BK on Linux: openxs@suse:~/dbs/5.1> bin/mysql -uroot test -e "CREATE TABLE tt(c1 int, index(c1))" openxs@suse:~/dbs/5.1> bin/mysqladmin -uroot shutdown STOPPING server from pid file /home/openxs/dbs/5.1/var/suse.pid 070302 07:32:58 mysqld ended [1]+ Done bin/mysqld_safe openxs@suse:~/dbs/5.1> cd var/test openxs@suse:~/dbs/5.1/var/test> ls -l tt* -rw-rw---- 1 openxs users 8556 2007-03-02 07:32 tt.frm -rw-rw---- 1 openxs users 0 2007-03-02 07:32 tt.MYD -rw-rw---- 1 openxs users 1024 2007-03-02 07:32 tt.MYI -rw-rw---- 1 openxs users 8582 2006-09-18 11:14 ttt.frm -rw-rw---- 1 openxs users 0 2006-09-18 11:14 ttt.MYD -rw-rw---- 1 openxs users 1024 2006-09-18 11:14 ttt.MYI openxs@suse:~/dbs/5.1/var/test> ../../bin/myisampack tt.MYI Compressing tt.MYD: (0 records) - Calculating statistics - Compressing file Empty file saved in compressed format Remember to run myisamchk -rq on compressed tables openxs@suse:~/dbs/5.1/var/test> ../../bin/myisamchk -rq tt.MYI - check record delete-chain - recovering (with sort) MyISAM-table 'tt.MYI' Data records: 0 - Fixing index 1 openxs@suse:~/dbs/5.1/var/test> ls -l tt* -rw-rw---- 1 openxs users 8556 2007-03-02 07:32 tt.frm -rw-rw---- 1 openxs users 48 2007-03-02 07:32 tt.MYD -rw-rw---- 1 openxs users 1024 2007-03-02 07:33 tt.MYI -rw-r----- 1 openxs users 1024 2007-03-02 07:33 tt.MYI.MYI -rw-rw---- 1 openxs users 8582 2006-09-18 11:14 ttt.frm -rw-rw---- 1 openxs users 0 2006-09-18 11:14 ttt.MYD -rw-rw---- 1 openxs users 1024 2006-09-18 11:14 ttt.MYI
[2 Mar 2007 9:06]
Ingo Strüwing
Regarding the patch which was also suggested in internals@lists.mysql.com: Wouldn't it be sufficient to always use MY_REPLACE_EXT? Doesn't it append the extension anyway if none exists? And shouldn't it be fixed in 5.0 too?
[2 Mar 2007 14:27]
David Shrewsbury
Bug does not exist in 5.0.27.
[6 Mar 2007 11:16]
Lenz Grimmer
See http://lists.mysql.com/internals/34349 for further discussion related to this patch
[6 Mar 2007 19:59]
Ingo Strüwing
The patch from David Shrewsbury is ok. I will bring it on its way.
[7 Mar 2007 16:31]
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/commits/21367 ChangeSet@1.2468, 2007-03-07 16:30:13+01:00, istruewing@chilla.local +1 -0 Bug#26782 - Patch: myisamchk -rq creates .MYI.MYI file on packed MyISAM tables When fixing the indexes with "myisamchk -rq" after compressing the table with "myisampack", an optionally supplied extension ".MYI" of the index file was not detected. The extension was appended unconditionally. The result was ".MYI.MYI". Now an extension is no longer appended if present already. Thanks to David Shrewsbury for providing this patch. Another problem was a misplaced parenthesis. We did never unpack the file name ("~/..") and always returned a real path. No test case. This is manually tested with the utilities "myisampack" and "myisamchk".
[7 Mar 2007 17:21]
Sergey Vojtovich
Approved.
[16 Mar 2007 13:01]
Alexander Barkov
The patch looks ok.
[23 Mar 2007 10:26]
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/commits/22736 ChangeSet@1.2496, 2007-03-23 10:26:14+01:00, istruewing@chilla.local +1 -0 Bug#26782 - Patch: myisamchk -rq creates .MYI.MYI file on packed MyISAM tables After merge fix In conjunction with the newest 5.1 we always need to create a real path name to be able to detect already open tables.
[23 Mar 2007 14:28]
Ingo Strüwing
Queued to 5.1-engines.
[30 Mar 2007 19:28]
Bugs System
Pushed into 5.1.18-beta
[13 Apr 2007 20:12]
Paul DuBois
Noted in 5.1.18 changelog. If the name of a table given to myisamchk -rq was a packed table and the name included the .MYI extension, myisamchk incorrectly created a file with a .MYI.MYI extension.
