diff options
author | Vasil Dimov <vasil.dimov@oracle.com> | 2010-10-18 13:48:11 +0300 |
---|---|---|
committer | Vasil Dimov <vasil.dimov@oracle.com> | 2010-10-18 13:48:11 +0300 |
commit | 33496519e15c018cc19761e05bcf19b7e89615a9 (patch) | |
tree | 1c4be19d8bb076d7ac1d90bbf985f356043b0ab6 /storage | |
parent | 3ed02e76aad4107ef8197c12a6cc7ec5f6967b6e (diff) | |
download | mariadb-git-33496519e15c018cc19761e05bcf19b7e89615a9.tar.gz |
Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
In order to fix this bug we need to distinguish whether ha_innobase::info()
has been called from ::analyze() or not. Rename ::info() to ::info_low()
and add a boolean parameter that tells whether the call is from ::analyze()
or not. Create a new simple ::info() that just calls
::info_low(false => not called from analyze). From ::analyze() instead of
::info() call ::info_low(true => called from analyze).
Approved by: Jimmy (rb://487)
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 26 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.h | 1 |
2 files changed, 22 insertions, 5 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d5944864ad9..5a8f5479223 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6367,9 +6367,12 @@ Returns statistics information of the table to the MySQL interpreter, in various fields of the handle object. */ int -ha_innobase::info( -/*==============*/ - uint flag) /* in: what information MySQL requests */ +ha_innobase::info_low( +/*==================*/ + uint flag, /* in: what information MySQL + requests */ + bool called_from_analyze) /* in: TRUE if called from + ::analyze() */ { dict_table_t* ib_table; dict_index_t* index; @@ -6400,7 +6403,7 @@ ha_innobase::info( ib_table = prebuilt->table; if (flag & HA_STATUS_TIME) { - if (innobase_stats_on_metadata) { + if (called_from_analyze || innobase_stats_on_metadata) { /* In sql_show we call with this flag: update then statistics so that they are up-to-date */ @@ -6616,6 +6619,18 @@ func_exit: DBUG_RETURN(0); } +/************************************************************************* +Returns statistics information of the table to the MySQL interpreter, +in various fields of the handle object. */ + +int +ha_innobase::info( +/*==============*/ + uint flag) /* in: what information MySQL requests */ +{ + return(info_low(flag, false /* not called from analyze */)); +} + /************************************************************************** Updates index cardinalities of the table, based on 8 random dives into each index tree. This does NOT calculate exact statistics on the table. */ @@ -6632,7 +6647,8 @@ ha_innobase::analyze( pthread_mutex_lock(&analyze_mutex); /* Simply call ::info() with all the flags */ - info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE); + info_low(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE, + true /* called from analyze */); pthread_mutex_unlock(&analyze_mutex); diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index eb9199b8955..8b91f7d4c51 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -80,6 +80,7 @@ class ha_innobase: public handler ulong innobase_update_autoinc(ulonglong auto_inc); void innobase_initialize_autoinc(); dict_index_t* innobase_get_index(uint keynr); + int info_low(uint flag, bool called_from_analyze); /* Init values for the class: */ public: |