Bug 33116

Summary: Limit reports execution time with SQL variables
Product: Koha Reporter: Didier Gautheron <didier.gautheron>
Component: ReportsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: magnus
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33502
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 33116: Add sql statement limit to report query

Description Didier Gautheron 2023-03-02 14:24:52 UTC
Users' SQL reports can run for a very long time and users can create cartesean products which severely impact server performance.
Moreover it doesn't help there's a lot of sample koha reports using the old cartesean prone join synxtax.

This patch add two optional koha-conf parameters:
- report_sql_max_statement_time for mysql sql_max_statement_time
- report_sql_max_join_size for sql_max_join_size
Comment 1 Didier Gautheron 2023-03-03 11:39:57 UTC
Created attachment 147689 [details] [review]
Bug 33116: Add sql statement limit to report query
Comment 2 Magnus Enger 2023-04-12 07:26:54 UTC
Is this "work in progress" or should it be "Needs Signoff"? 

If it is meant for signoff, I think it also needs to update etc/koha-conf.xml, and include a test plan. But this sure sounds like something that will be a good thing to have!