Bug #51381 HA_ADMIN_TRY_ALTER does not work without handler::analyze
Submitted: 22 Feb 2010 11:09 Modified: 23 Feb 2010 20:21
Reporter: Sergei Golubchik Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Storage Engine API Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any

[22 Feb 2010 11:09] Sergei Golubchik
Description:
An engine can return HA_ADMIN_TRY_ALTER from its ::optimize() method, which will cause OPTIMIZE TABLE to work by copying the data over to a new table with the same structure.

But the implementation of HA_ADMIN_TRY_ALTER calls handler::analyze() method after recreating the table, and fails if analyze fails.

That means an engine cannot have

optimize = HA_ADMIN_TRY_ALTER
analyze = HA_ADMIN_NOT_IMPLEMENTED

and for "optimize by copying" to work the engine has to claim that analyze works too.

How to repeat:
see sql_table.cc

Suggested fix:
don't fail OPTIMIZE TABLE if analyze is not implemented
[23 Feb 2010 20:21] MySQL Verification Team
Thank you for the bug report.