summaryrefslogtreecommitdiff
path: root/plugin/qc_info
diff options
context:
space:
mode:
authorPeter Shchuchkin <peters@yandex.ru>2017-08-25 12:56:42 +0300
committerSergey Vojtovich <svoj@mariadb.org>2017-08-31 13:50:25 +0400
commit41d89b7da14cede0dad786e0594a83ae717637e9 (patch)
tree2c24ff249f8f6f752b5f488c681a52c0bb14428a /plugin/qc_info
parentcf3a74eb60410e092c3098e77d818b7953c41d16 (diff)
downloadmariadb-git-41d89b7da14cede0dad786e0594a83ae717637e9.tar.gz
Added HITS column to QUERY_CACHE_INFO table
Updated qc_info tests, added new test that checks HITS is incremented.
Diffstat (limited to 'plugin/qc_info')
-rw-r--r--plugin/qc_info/qc_info.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc
index b7d7e6f1f45..c01207571d2 100644
--- a/plugin/qc_info/qc_info.cc
+++ b/plugin/qc_info/qc_info.cc
@@ -77,6 +77,7 @@ bool schema_table_store_record(THD *thd, TABLE *table);
#define COLUMN_IN_TRANS 20
#define COLUMN_AUTOCOMMIT 21
#define COLUMN_PKT_NR 22
+#define COLUMN_HITS 23
/* ST_FIELD_INFO is defined in table.h */
static ST_FIELD_INFO qc_info_fields[]=
@@ -104,6 +105,7 @@ static ST_FIELD_INFO qc_info_fields[]=
{"IN_TRANS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_TINY, 0, 0, 0, 0},
{"AUTOCOMMIT", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_TINY, 0, 0, 0, 0},
{"PACKET_NUMBER", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_TINY, 0, 0, 0, 0},
+ {"HITS", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, MY_I_S_UNSIGNED, 0, 0},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0}
};
@@ -216,6 +218,7 @@ static int qc_info_fill_table(THD *thd, TABLE_LIST *tables,
table->field[COLUMN_IN_TRANS]->store(flags.in_trans, 0);
table->field[COLUMN_AUTOCOMMIT]->store(flags.autocommit, 0);
table->field[COLUMN_PKT_NR]->store(flags.pkt_nr, 0);
+ table->field[COLUMN_HITS]->store(query_cache_query->hits(), 0);
/* The database against which the statement is executed is part of the
query cache query key