Bug #37999 incorrectly documented utility of mysqlcheck for checking partitoned tables.
Submitted: 9 Jul 2008 19:15 Modified: 10 Jul 2008 14:53
Reporter: Matthew Montgomery Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S2 (Serious)
Version:5.1, 6.0 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[9 Jul 2008 19:15] Matthew Montgomery
Description:
According to http://dev.mysql.com/doc/refman/5.1/en/partitioning-maintenance.html

"The statements ANALYZE PARTITION, CHECK PARTITION, OPTIMIZE PARTITION, and REPAIR PARTITION  were also introduced in MySQL 5.1.5 for the purpose of, respectively, analyzing, checking, optimizing, and repairing individual or multiple partitions. Support for these statements was removed in MySQL 5.1.24. (Bug#20129) To accomplish these tasks, you can use mysqlcheck or, with partitioned MyISAM tables, you can use myisamchk."

How to repeat:

$ mysql -S /tmp/mysql_sandbox5125.sock 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.1.25-rc MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test; 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> CREATE TABLE t1 ( id INT NOT NULL PRIMARY KEY, fname VARCHAR(30), lname VARCHAR(30)) PARTITION BY KEY() PARTITIONS 2;
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye
$ ./mysql/sandbox/binaries/5.1.25/bin/mysqlcheck -S /tmp/mysql_sandbox5125.sock -a test t1
test.t1
note     : The storage engine for the table doesn't support analyze
$ ./mysql/sandbox/binaries/5.1.25/bin/mysqlcheck -S /tmp/mysql_sandbox5125.sock -o test t1
test.t1
note     : The storage engine for the table doesn't support optimize
$ ./mysql/sandbox/binaries/5.1.25/bin/mysqlcheck -S /tmp/mysql_sandbox5125.sock -r test t1
test.t1
note     : The storage engine for the table doesn't support repair

Suggested fix:
Only myisamchk can be used to perform check and repair operations.  There is no OPTIMIZE capable with myisamcheck.  Only ALTER TABLE... REBUILD PARTITION p_name or REORGANIZE PARTITIONS (definitions) will perform OPTIMIZE-esque actions.

See also Bug #20129
[10 Jul 2008 14:53] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.