Commit 62df3119 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Add a counter for the number of select statements using window functions

The counter is available via SHOW [GLOBAL] STATUS and will be reported
by the feedback plugin.
parent 5cb56878
......@@ -8411,6 +8411,7 @@ SHOW_VAR status_vars[]= {
{"Feature_subquery", (char*) offsetof(STATUS_VAR, feature_subquery), SHOW_LONG_STATUS},
{"Feature_timezone", (char*) offsetof(STATUS_VAR, feature_timezone), SHOW_LONG_STATUS},
{"Feature_trigger", (char*) offsetof(STATUS_VAR, feature_trigger), SHOW_LONG_STATUS},
{"Feature_window_functions", (char*) offsetof(STATUS_VAR, feature_window_functions), SHOW_LONG_STATUS},
{"Feature_xml", (char*) offsetof(STATUS_VAR, feature_xml), SHOW_LONG_STATUS},
{"Flush_commands", (char*) &show_flush_commands, SHOW_SIMPLE_FUNC},
{"Handler_commit", (char*) offsetof(STATUS_VAR, ha_commit_count), SHOW_LONG_STATUS},
......
......@@ -789,6 +789,7 @@ typedef struct system_status_var
ulong feature_timezone; /* +1 when XPATH is used */
ulong feature_trigger; /* +1 opening a table with triggers */
ulong feature_xml; /* +1 when XPATH is used */
ulong feature_window_functions; /* +1 when window functions are used */
/* From MASTER_GTID_WAIT usage */
ulonglong master_gtid_wait_timeouts; /* Number of timeouts */
......
......@@ -2699,6 +2699,8 @@ bool JOIN::make_aggr_tables_info()
if (curr_tab->window_funcs_step->setup(thd, &select_lex->window_funcs,
curr_tab))
DBUG_RETURN(true);
/* Count that we're using window functions. */
status_var_increment(thd->status_var.feature_window_functions);
}
fields= curr_fields_list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment