--- mariadb-10.0.4-original/plugin/query_response_time/plugin.cc 2013-08-18 02:55:32.733267143 -0300 +++ mariadb-10.0.4/plugin/query_response_time/plugin.cc 2013-08-18 05:08:57.188404601 -0300 @@ -19,7 +19,7 @@ #include #include #include "query_response_time.h" - +#include "log_slow.h" /* QPLAN_QC */ ulong opt_query_response_time_range_base= QRT_DEFAULT_BASE; my_bool opt_query_response_time_stats= 0; @@ -75,6 +75,8 @@ { "TIME", QRT_TIME_STRING_LENGTH, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE }, { "COUNT", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE }, { "TOTAL", QRT_TIME_STRING_LENGTH, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE }, + { "QC_COUNT", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, "", SKIP_OPEN_TABLE }, + { "QC_TOTAL", QRT_TIME_STRING_LENGTH, MYSQL_TYPE_STRING, 0, 0, "", SKIP_OPEN_TABLE }, { 0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0 } }; @@ -113,11 +115,13 @@ { #ifndef DBUG_OFF if (THDVAR(thd, exec_time_debug)) - query_response_time_collect(thd->lex->sql_command != SQLCOM_SET_OPTION ? + query_response_time_collect((thd->query_plan_flags & QPLAN_QC) !=0?1:0, + thd->lex->sql_command != SQLCOM_SET_OPTION ? THDVAR(thd, exec_time_debug) : 0); else #endif - query_response_time_collect(thd->utime_after_query - thd->utime_after_lock); + query_response_time_collect((thd->query_plan_flags & QPLAN_QC) !=0?1:0, + thd->utime_after_query - thd->utime_after_lock); } } @@ -142,7 +146,7 @@ 0x0100, NULL, query_response_time_info_vars, - "1.0", + "1.1", MariaDB_PLUGIN_MATURITY_ALPHA }, { @@ -157,7 +161,7 @@ 0x0100, NULL, NULL, - "1.0", + "1.1", MariaDB_PLUGIN_MATURITY_ALPHA } maria_declare_plugin_end;