Bug #75464 Inconsistent error reporting about persistent statistics tables
Submitted: 9 Jan 2015 10:36 Modified: 9 Jan 2015 15:46
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.6 OS:Any
Assigned to: CPU Architecture:Any

[9 Jan 2015 10:36] Marko Mäkelä
Description:
The file dict0stats.cc defines two sets of symbols, for internal and external names of the tables that store persistent statistics:

#define TABLE_STATS_NAME	"mysql/innodb_table_stats"
#define TABLE_STATS_NAME_PRINT	"mysql.innodb_table_stats"
#define INDEX_STATS_NAME	"mysql/innodb_index_stats"
#define INDEX_STATS_NAME_PRINT	"mysql.innodb_index_stats"

The names with _PRINT are indented for use in diagnostic output. However, there are two messages that use the internal names (the symbols with no _PRINT suffix).

How to repeat:
See above and below.

Suggested fix:
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index 533f83f..0c02ca8 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -3213,9 +3213,10 @@ dict_stats_update(
 			ib::info() << "Trying to use table " << table->name
 				<< " which has persistent statistics enabled,"
 				" but auto recalculation turned off and the"
-				" statistics do not exist in " TABLE_STATS_NAME
-				" and " INDEX_STATS_NAME ". Please either run"
-				" \"ANALYZE TABLE "
+				" statistics do not exist in "
+				TABLE_STATS_NAME_PRINT
+				" and " INDEX_STATS_NAME_PRINT
+				". Please either run \"ANALYZE TABLE "
 				<< table->name << ";\" manually or enable the"
 				" auto recalculation with \"ALTER TABLE "
 				<< table->name << " STATS_AUTO_RECALC=1;\"."
@@ -3230,8 +3231,8 @@ dict_stats_update(
 			ib::error() << "Error fetching persistent statistics"
 				" for table "
 				<< table->name
-				<< " from " TABLE_STATS_NAME " and "
-				INDEX_STATS_NAME ": " << ut_strerr(err)
+				<< " from " TABLE_STATS_NAME_PRINT " and "
+				INDEX_STATS_NAME_PRINT ": " << ut_strerr(err)
 				<< ". Using transient stats method instead.";
 
 			goto transient;
[9 Jan 2015 15:46] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.6 release, and here's the changelog entry:

Table names were displayed inconsistently in diagnostic output for
"InnoDB" tables that store persistent statistics.