Description:
MySQL 5.6.26 and 5.7.8 has the following incompatible change:
Current-event timing now provides more information. Previously, while a wait, stage, or statement event was executing, the respective tables displayed the event with TIMER_START populated, but with TIMER_END and TIMER_WAIT as NULL:
events_waits_current
events_stages_current
events_statements_current
To make it possible to determine how how long a not-yet-completed event has been running, the timer columns now are set as follows:
TIMER_START is populated (unchanged from previous behavior)
TIMER_END is populated with the current timer value
TIMER_WAIT is populated with the time elapsed so far (TIMER_END − TIMER_START)
To find events that have not yet completed (that is, have no END_EVENT_ID) and have taken longer than N picoseconds thus far, monitoring applications can use this expression in queries:
WHERE END_EVENT_ID IS NULL AND TIMER_WAIT > N
(Bug #75156, Bug #20889406)
However Sys Schema version 1.4.0 assumes TIMER_WAIT is null for queries that have not yet completed.
How to repeat:
See the various processlist view definitions, e.g.
views/p_s/processlist_57.sql:
...
IF(esc.timer_wait IS NOT NULL,
sys.format_statement(esc.sql_text),
NULL) AS last_statement,
IF(esc.timer_wait IS NOT NULL,
sys.format_time(esc.timer_wait),
NULL) AS last_statement_latency,
ewc.event_name AS last_wait,
IF(ewc.timer_wait IS NULL AND ewc.event_name IS NOT NULL,
'Still Waiting',
sys.format_time(ewc.timer_wait)) last_wait_latency,
...
Suggested fix:
Change the processlist views to use IF(esc.end_event_id IS NOT NULL, ...) instead.