Bug #81796 Slow_queries not incremented if slow_query_log is OFF.
Submitted: 10 Jun 2016 4:09 Modified: 20 Jun 2016 10:46
Reporter: vishnu rao (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.7.10, 5.7.13 OS:Linux
Assigned to: CPU Architecture:Any

[10 Jun 2016 4:09] vishnu rao
Description:
As per the documentation for long_query_time:

"If a query takes longer than this many seconds, the server increments the Slow_queries status variable."

If the slow_query_log is enabled then this query is logged.

But

In 5.7, if the slow_query_log is OFF, the counter is not incremented even if the query took greater than long_query_time.

This used to work in 5.6.

How to repeat:
set long_query_time = 10;

set slow_query_log = 0;

select sleep(12); # ie. greater than 10 seconds

show global status like '%Slow_queries%'; 

the count will be 0
[20 Jun 2016 10:46] Umesh Shastry
Hello Vishnu Rao,

Thank you for the report.

Thanks,
Umesh