]> git.koha-community.org Git - koha.git/commit
Bug 37476: Fix reserved word error on Serials.pm on MySQL 8
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 25 Jul 2024 16:29:42 +0000 (13:29 -0300)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 29 Aug 2024 16:59:24 +0000 (16:59 +0000)
commit10f8db24704139fdd90e73c1670149244b5a6dab
treea0fd4c71a1b280f932eb76723634ba5047eb5622
parente92dc8e7adcdeef51820f414948036d2ca482485
Bug 37476: Fix reserved word error on Serials.pm on MySQL 8

This patch fixes the fact `RANK` become a reserved word in MySQL 8.0.2
[1]

To test:
1. Launch KTD with MySQL 8:
   $ ktd down
   $ DB_IMAGE=mysql:8 ktd up -d
2. Open the logs
   $ ktd --shell
  k$ tail -f /var/log/koha/kohadev/*.log
3. Create a serial, receive an issue and try to create a routing list
4. Click on `+ Add recipients` and look for Henry
5. Click `Add` and then `Close`
=> FAIL: Henry not added
=> FAIL: The logs show an error about wrong SQL syntax
6. Run:
  k$ prove t/db_dependent/Serials.t
=> FAIL: Tests explode with the same kind of error!
6. Apply this patch
7. Restart plack
8. Repeat 3 through 6
=> SUCCESS: Henry added!
=> SUCCESS: No explosion about the SQL syntax in the logs
=> SUCCESS: Tests pass!
9. Sign off :-D

[1] https://dev.mysql.com/doc/refman/8.0/en/keywords.html

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a4b9dcaf61c657a315e0de16e0d68163ece9ed0e)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Serials.pm