From 41d89b7da14cede0dad786e0594a83ae717637e9 Mon Sep 17 00:00:00 2001 From: Peter Shchuchkin Date: Fri, 25 Aug 2017 12:56:42 +0300 Subject: Added HITS column to QUERY_CACHE_INFO table Updated qc_info tests, added new test that checks HITS is incremented. --- plugin/qc_info/qc_info.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugin/qc_info') 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 -- cgit v1.2.1