diff --git a/include/query_processor.h b/include/query_processor.h index 25112afac..5e17903c0 100644 --- a/include/query_processor.h +++ b/include/query_processor.h @@ -324,7 +324,9 @@ class Query_Processor { SQLite3_result * get_query_digests(); SQLite3_result * get_query_digests_reset(); std::pair get_query_digests_v2(const bool use_resultset = true); - std::pair get_query_digests_reset_v2(const bool use_resultset = true); + std::pair get_query_digests_reset_v2( + const bool copy, const bool use_resultset = true + ); void get_query_digests_reset(umap_query_digest *uqd, umap_query_digest_text *uqdt); unsigned long long purge_query_digests(bool async_purge, bool parallel, char **msg); unsigned long long purge_query_digests_async(char **msg); diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 9d3bf39dd..3d87fc382 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -9673,7 +9673,7 @@ int ProxySQL_Admin::stats___mysql_query_digests_v2(bool reset, bool copy, bool u if (!GloQPro) return 0; std::pair res; if (reset == true) { - res = GloQPro->get_query_digests_reset_v2(use_resultset); + res = GloQPro->get_query_digests_reset_v2(copy, use_resultset); } else { res = GloQPro->get_query_digests_v2(use_resultset); } diff --git a/lib/Query_Processor.cpp b/lib/Query_Processor.cpp index 1debd1a4c..04fba0aaf 100644 --- a/lib/Query_Processor.cpp +++ b/lib/Query_Processor.cpp @@ -1401,7 +1401,9 @@ SQLite3_result * Query_Processor::get_query_digests() { return result; } -std::pair Query_Processor::get_query_digests_reset_v2(const bool use_resultset) { +std::pair Query_Processor::get_query_digests_reset_v2( + const bool copy, const bool use_resultset +) { SQLite3_result *result = NULL; umap_query_digest digest_umap_aux; umap_query_digest_text digest_text_umap_aux; @@ -1477,7 +1479,7 @@ std::pair Query_Processor::get_query_digests_reset_v2(con } } else { num_rows = GloAdmin->stats___save_mysql_query_digest_to_sqlite( - false, false, result, &digest_umap_aux, &digest_text_umap_aux + true, copy, result, &digest_umap_aux, &digest_text_umap_aux ); for ( std::unordered_map::iterator it = digest_umap_aux.begin();