1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-21187: log_slow_filter="" logs queries not using indexes

Consistent with MDEV-4206 and empty log_slow_filter still means
no explict filtering. Since 21518ab2e4 however the
log_queries_not_using_indexes became stored in the same variable.

As we need to test for the absense of log_queries_not_using_indexes
the SERVER_QUERY_NO_INDEX USED part of log_slow_statement, the empty
criteria resulted in an always true to log queries not using indexes if
log_slow_filter was set to empty.

Adjusted the log_slow.test for MDEV-4206 as slow_log_query has been
global and session for a while and it was relying on the MDEV-21187
buggy behavior to detect a slow query.

Reviewer: Monty
This commit is contained in:
Daniel Black
2022-12-04 10:47:31 +11:00
parent acfaa04587
commit 697dbd15e0
3 changed files with 40 additions and 5 deletions

View File

@ -2513,7 +2513,7 @@ void log_slow_statement(THD *thd)
if ((thd->server_status &
(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
!(thd->query_plan_flags & QPLAN_STATUS) &&
!slow_filter_masked(thd, QPLAN_NOT_USING_INDEX))
(thd->variables.log_slow_filter & QPLAN_NOT_USING_INDEX))
{
thd->query_plan_flags|= QPLAN_NOT_USING_INDEX;
/* We are always logging no index queries if enabled in filter */