Comment 3 for bug 655186

Revision history for this message
Michael Widenius (monty) wrote : [Bug 655186] Re: disabling innobase_stats_on_metadata disables ANALYZE

Hi!

>>>>> "Yasufumi" == Yasufumi Kinoshita <email address hidden> writes:

Yasufumi> XtraDB already has the following code.
Yasufumi> if (flag & HA_STATUS_TIME) {
Yasufumi> - if (innobase_stats_on_metadata) {
Yasufumi> + if (innobase_stats_on_metadata
Yasufumi> + || thd_sql_command(user_thd) == SQLCOM_ANALYZE
Yasufumi> + ) {
Yasufumi> /* In sql_show we call with this flag: update
Yasufumi> then statistics so that they are up-to-date */

Yasufumi> Why was the bug confirmed??

I don't think you should depend on the SQLCOM_ANALYZE status; Someone
may want in the future to call analyze() from other points in the code.

A better way would be to add an engine specific
HA_STATUS_INNODB_ANALYZE flag from ha_innobase::analyze() and test
this in info().

Regards,
Monty