summaryrefslogtreecommitdiff
path: root/plugin/feedback
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
committerSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
commitf62c12b405ba7ec80b8e2490856b83c6f5899211 (patch)
tree010605c7f145da6ea6ac14b39abc4cf700d619b1 /plugin/feedback
parentf947f73b2b6d2bd246b81a9038224d2a85777520 (diff)
parentf1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff)
downloadmariadb-git-f62c12b405ba7ec80b8e2490856b83c6f5899211.tar.gz
Merge 10.0.14 into 10.1
Diffstat (limited to 'plugin/feedback')
-rw-r--r--plugin/feedback/feedback.cc3
-rw-r--r--plugin/feedback/feedback.h1
-rw-r--r--plugin/feedback/utils.cc19
3 files changed, 22 insertions, 1 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index 54459ae6f17..f644bd597d9 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -217,7 +217,8 @@ int fill_feedback(THD *thd, TABLE_LIST *tables, COND *unused)
tables->schema_table= i_s_feedback;
res= res || fill_plugin_version(thd, tables)
|| fill_misc_data(thd, tables)
- || fill_linux_info(thd, tables);
+ || fill_linux_info(thd, tables)
+ || fill_collation_statistics(thd, tables);
return res;
}
diff --git a/plugin/feedback/feedback.h b/plugin/feedback/feedback.h
index c5acbb5ef72..c2091afdedc 100644
--- a/plugin/feedback/feedback.h
+++ b/plugin/feedback/feedback.h
@@ -22,6 +22,7 @@ int fill_feedback(THD *thd, TABLE_LIST *tables, COND *cond);
int fill_plugin_version(THD *thd, TABLE_LIST *tables);
int fill_misc_data(THD *thd, TABLE_LIST *tables);
int fill_linux_info(THD *thd, TABLE_LIST *tables);
+int fill_collation_statistics(THD *thd, TABLE_LIST *tables);
static const int SERVER_UID_SIZE= 29;
extern char server_uid_buf[SERVER_UID_SIZE+1], *user_info;
diff --git a/plugin/feedback/utils.cc b/plugin/feedback/utils.cc
index 0510140aee9..b83b69be0ce 100644
--- a/plugin/feedback/utils.cc
+++ b/plugin/feedback/utils.cc
@@ -383,6 +383,25 @@ int fill_misc_data(THD *thd, TABLE_LIST *tables)
return 0;
}
+int fill_collation_statistics(THD *thd, TABLE_LIST *tables)
+{
+ TABLE *table= tables->table;
+ for (uint id= 1; id < MY_ALL_CHARSETS_SIZE; id++)
+ {
+ ulonglong count;
+ if (my_collation_is_known_id(id) &&
+ (count= my_collation_statistics_get_use_count(id)))
+ {
+ char name[MY_CS_NAME_SIZE + 32];
+ size_t namelen= my_snprintf(name, sizeof(name),
+ "Collation used %s",
+ get_charset_name(id));
+ INSERT2(name, namelen, (count, UNSIGNED));
+ }
+ }
+ return 0;
+};
+
/**
calculates the server unique identifier