From fc744096ea17aa9cbcee3b5665e82e06ca22f834 Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Thu, 10 Oct 2024 12:54:54 +0500 Subject: [PATCH] Improved PROXYSQL FLUSH PGSQL QUERY CACHE --- lib/Admin_Handler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Admin_Handler.cpp b/lib/Admin_Handler.cpp index 0e7017797..266041889 100644 --- a/lib/Admin_Handler.cpp +++ b/lib/Admin_Handler.cpp @@ -679,10 +679,11 @@ bool admin_handler_command_proxysql(char *query_no_space, unsigned int query_no_ if (query_no_space_length == strlen("PROXYSQL FLUSH PGSQL QUERY CACHE") && !strncasecmp("PROXYSQL FLUSH PGSQL QUERY CACHE", query_no_space, query_no_space_length)) { proxy_info("Received PROXYSQL FLUSH PGSQL QUERY CACHE command\n"); ProxySQL_Admin* SPA = (ProxySQL_Admin*)pa; + uint64_t count = 0; if (GloPgQC) { - GloPgQC->flush(); + count = GloPgQC->flush(); } - SPA->send_ok_msg_to_client(sess, NULL, 0, query_no_space); + SPA->send_ok_msg_to_client(sess, NULL, (int)count, "DELETE "); return false; }