[Koha-bugs] [Bug 24695] Improve SQL report validation

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 9 18:44:01 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24695

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #117352|0                           |1
        is obsolete|                            |

--- Comment #15 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 119421
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=119421&action=edit
Bug 24695: Improve SQL report validation

The saved SQL report code validates the SQL in multiple places:
when saving, when updating, and when executing the query.
Move the validation code into Koha::Reports, and write tests for it.

Test plan:
1) Apply patch
2) Create a new valid SQL report, save it (success)
3) Create a new illegal SQL report, try to save (fails)
4) Update already saved SQL report by adding one of
   the forbidden words, eg. delete or drop (saving will fail)
5) Edit a save_sql in the database, changing it to eg.
   "drop borrowers", and try to execute it (fails)
6) Prove t/db_dependent/Koha/Reports.t

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel at gmail.com>
Work as described, no qa errors.

Signed-off-by: Owen Leonard <oleonard at myacpl.org>

Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list