Comment 2 for bug 655186

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

Hi!

>>>>> "Stewart" == Stewart Smith <email address hidden> writes:

Stewart> Public bug reported:
Stewart> ha_innobase::analyze(
Stewart> /*=================*/
Stewart> THD* thd, /*!< in: connection thread handle */
Stewart> HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
Stewart> {
Stewart> /* Simply call ::info() with all the flags */
Stewart> info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);

Stewart> return(0);
Stewart> }

Stewart> versus this code in ::info():

Stewart> if (flag & HA_STATUS_TIME) {
Stewart> if (innobase_stats_on_metadata) {
Stewart> /* In sql_show we call with this flag: update
Stewart> then statistics so that they are up-to-date */

Stewart> prebuilt->trx->op_info = "updating table
Stewart> statistics";

Stewart> dict_update_statistics(ib_table);

Stewart> prebuilt->trx->op_info = "returning various info to MySQL";
Stewart> }

Stewart> The solution is pretty simple, in ::info() do something like the following:

Stewart> if (! innobase_stats_on_metadata)
Stewart> dict_update_statistics(prebuilt->table);

Stewart> It does not seem like it was the intention of innobase_stats_on_metadata to also disable ANALYZE

Good catch.

Vadim, can you add this fix to xtradb?

Regards,
Monty