From 4cd0774549f9257785690e0d2b1ef7bbd1326abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 13 May 2022 09:38:27 +0200 Subject: [PATCH 1/2] Fix 'int' overflow when computing 'next_timer_mysql_query_digest_to_disk' #3873 --- lib/ProxySQL_Statistics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ProxySQL_Statistics.cpp b/lib/ProxySQL_Statistics.cpp index 205ca5cb7d..a958b58b34 100644 --- a/lib/ProxySQL_Statistics.cpp +++ b/lib/ProxySQL_Statistics.cpp @@ -218,7 +218,7 @@ bool ProxySQL_Statistics::MySQL_Query_Cache_timetoget(unsigned long long curtime } bool ProxySQL_Statistics::mysql_query_digest_to_disk_timetoget(unsigned long long curtime) { - unsigned int i = (unsigned int)variables.stats_mysql_query_digest_to_disk; + unsigned long i = (unsigned long)variables.stats_mysql_query_digest_to_disk; if (i) { if ( ( curtime > next_timer_mysql_query_digest_to_disk ) From f05ebe3b512cddda18809153682c24c1f008d06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 13 May 2022 09:45:14 +0200 Subject: [PATCH 2/2] Fix range of 'admin-stats_mysql_digest_to_disk' to match doc #3873 --- lib/ProxySQL_Admin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 539dc7991a..45dcd5c9e5 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -7773,7 +7773,7 @@ bool ProxySQL_Admin::set_variable(char *name, char *value) { // this is the pub } if (!strcasecmp(name,"stats_mysql_query_digest_to_disk")) { int intv=atoi(value); - if (intv >= 0 && intv < 24*3600) { + if (intv >= 0 && intv <= 24*3600) { variables.stats_mysql_query_digest_to_disk=intv; GloProxyStats->variables.stats_mysql_query_digest_to_disk=intv; return true;