From d6dcc9f4c6397c99e261493b5e36fa2d43353ad8 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Fri, 2 Dec 2022 11:31:15 +0000 Subject: [PATCH] bugfix ClearSqlCache TIMESTAMPDIFF --- www/lib/class.erpapi.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index b915d780..88460bb0 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -7403,7 +7403,7 @@ function ClearSqlCache($shortcode, $seconds = 0) if($seconds > 0) { $this->app->DB->Delete( sprintf( - 'DELETE FROM sqlcache WHERE DATE_DIFF(zeitstempel, INTERVAL %d SECOND) < NOW()', + "DELETE FROM sqlcache WHERE TIMESTAMPDIFF(SECOND,zeitstempel, NOW()) > %d", $seconds ) ); @@ -7415,7 +7415,7 @@ function ClearSqlCache($shortcode, $seconds = 0) if($seconds > 0) { $this->app->DB->Delete( sprintf( - "DELETE FROM sqlcache WHERE shortcode = '%s' AND DATE_DIFF(zeitstempel, INTERVAL %d SECOND) < NOW()", + "DELETE FROM sqlcache WHERE shortcode = 'artikel' AND TIMESTAMPDIFF(SECOND,zeitstempel, NOW()) > %d", $this->app->DB->real_escape_string($shortcode), $seconds ) );