Bug 28804: (bug 25026 follow-up) Handle SQL errors in reports
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Aug 2021 06:59:40 +0000 (08:59 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Aug 2021 10:00:10 +0000 (12:00 +0200)
commitf2253158d795fb2fe47061d6235d3ff773eeed5c
treebf06a210cf125312a4b230671b67e7264c662080
parent89b634abc1b7eb42d63e00a7fe7d34b4c990f1c7
Bug 28804: (bug 25026 follow-up) Handle SQL errors in reports

Since bug 25026 DBMS errors are raised, but the report module is not
dealing correctly with the errors.
If an error occurred in execute_query, next queries will fail as well,
we should skip them.

Test plan:
1. Create report from SQL queries, containing errors (invalid syntax, etc.)
'SELECT id FROM borrowers' can do it
2. Execute the query
=> Without this patch you get a 500
=> With this patch applied you see that the error raised at DBMS level
is propagated to the UI
3. Confirm that there is no regression on valid queries

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
reports/guided_reports.pl