From 6b7f34812561d23393042c8d2e084f3e47e4371f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Oct 2021 11:08:29 +0200 Subject: [PATCH] Bug 29204: Fix reports/issues_stats.pl for MySQL 8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Error was: Incorrect DATETIME value: '' Test plan Go to Reports -> Circulation On Period select "Row" or "Column" and choose a date Submit Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 9a4b7b1948ecba51c942bdbb6b202981a6cce144) Signed-off-by: Fridolin Somers --- reports/issues_stats.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index 8f86fdb113..fd528575e0 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -319,7 +319,8 @@ sub calculate { ( $linesource eq 'items' ) ? " LEFT JOIN items ON (statistics.itemnumber = items.itemnumber) " : " LEFT JOIN borrowers ON (statistics.borrowernumber = borrowers.borrowernumber) "; - $strsth .= " WHERE $line is not null AND $line != '' "; + $strsth .= " WHERE $line IS NOT NULL "; + $strsth .= " AND $line != '' " if $line ne "datetime"; } if ( $line =~ /datetime/ ) { @@ -408,7 +409,8 @@ sub calculate { ( $colsource eq 'items' ) ? "LEFT JOIN items ON (statistics.itemnumber = items.itemnumber) " : "LEFT JOIN borrowers ON (statistics.borrowernumber = borrowers.borrowernumber) "; - $strsth2 .= " WHERE $column IS NOT NULL AND $column != '' "; + $strsth .= " WHERE $column IS NOT NULL"; + $strsth .= " AND $column != '' " if $column ne "datetime"; } if ( $column =~ /datetime/ ) { -- 2.39.5