Bug #937 myisamchk with 0 data record tables and --checked-only-changed
Submitted: 28 Jul 2003 12:47 Modified: 30 Jul 2003 7:12
Reporter: Sinisa Milivojevic Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:all OS:Any (all)
Assigned to: Sergei Golubchik

[28 Jul 2003 12:47] Sinisa Milivojevic
myisamchk tries to update table with 0 rows, although --checked-only-changed option is used.

How to repeat:
> check table.MYI=20
> =20
> myisamchk --extend-check -dvvv --check-only-changed table.MYI=20
> MyISAM file: table.MYI is already checked
> =20
> myisamchk -extend-check -ivvv --check-only-changed table.MYI=20
> MyISAM file: tab;e.MYI is already checked
> =20
> myisamchk --recover --analyze --sort-index --sort-records=3D1 --verbose =
--check-only-changed table.MYI=20
> - recovering (with sort) MyISAM-table 'table.MYI'
> Data records: 0
> - Fixing index 1
>   - Searching for keys, allocating buffer for 2 keys
>   - Dumping 0 keys
> - Sorting records for MyISAM-table 'table.MYI'
> - Sorting index for MyISAM-table 'tab;e.MYI'
> =20
>  9:49p
[30 Jul 2003 4:34] Sergei Golubchik
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem is not the result of a bug.
For a list of more appropriate places to ask for help using MySQL
products, please visit http://www.mysql.com/support/

Thank you for your interest in MySQL.

It has nothing to do with "no records" - behavour is identical for any

--check-only-changed means that table should be *checked* only if it's
marked as changed. It's not the option --process-only-changed.
It's listed in the "Check options" section of myisamchk.
And as such it does not change the behaviour of options that are not
check-related, that is --recover --analyze --sort-index --sort-records.

Any option from the above would be enough for myisamchk to do something:

% myisamchk --verbose --check-only-changed t1
MyISAM file: t1 is already checked

% myisamchk --analyze --verbose --check-only-changed t1
Checking MyISAM file: t1
Data records:       3   Deleted blocks:       0
- check file-size
- check key delete-chain
- check record delete-chain
No recordlinks
- check index reference

% myisamchk --recover --verbose --check-only-changed t1
- recovering (with keycache) MyISAM-table 't1'
Data records: 3
[30 Jul 2003 7:12] Sergei Golubchik
sorry, the above was wrong. --check-only-changed applies to other actions as well.
Help text is clarified to reflect this.
Bug with empty tables and --analyze fixed in 4.0.15