From be57a10c0803555a3bd256cd60d21a64af9ba139 Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Tue, 29 Aug 2023 20:07:38 +0700 Subject: [PATCH] MDL-72359 core_analytics: Better handling of MAX_TIME We are limited by both PHP's max int value and DB (cross-db) max int allowed. We need to use the smallest one --- analytics/classes/analysable.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analytics/classes/analysable.php b/analytics/classes/analysable.php index 20018528a20..968de63f683 100644 --- a/analytics/classes/analysable.php +++ b/analytics/classes/analysable.php @@ -37,8 +37,9 @@ interface analysable { /** * Max timestamp. + * We are limited by both PHP's max int value and DB (cross-db) max int allowed. Use the smallest one. */ - const MAX_TIME = PHP_INT_MAX; + const MAX_TIME = PHP_INT_MAX < 9999999999 ? PHP_MAX_INT : 9999999999; /** * The analysable unique identifier in the site. -- 2.11.4.GIT