From faa3752e4cff45bff826bafa08604259d75a1360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 23 Oct 2016 12:40:32 +0000 Subject: [PATCH] Queries were not logged #723 mysql_query_rules.log was ignored --- lib/Query_Processor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Query_Processor.cpp b/lib/Query_Processor.cpp index 3b214c6e2..c27f9f7f7 100644 --- a/lib/Query_Processor.cpp +++ b/lib/Query_Processor.cpp @@ -824,6 +824,11 @@ __internal_loop: proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 5, "query rule %d has set cache_ttl: %d. Query will%s hit the cache\n", qr->rule_id, qr->cache_ttl, (qr->cache_ttl == 0 ? " NOT" : "" )); ret->cache_ttl=qr->cache_ttl; } + if (qr->log >= 0) { + // Note: negative log means this rule doesn't change + proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 5, "query rule %d has set log: %d. Query will%s logged\n", qr->rule_id, qr->log, (qr->log == 0 ? " NOT" : "" )); + ret->log=qr->log; + } if (qr->destination_hostgroup >= 0) { // Note: negative hostgroup means this rule doesn't change proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 5, "query rule %d has set destination hostgroup: %d\n", qr->rule_id, qr->destination_hostgroup);