Bug 32470 - (Bug 14783 follow-up) Fix mysql error in db_rev for 22.06.000.064
Summary: (Bug 14783 follow-up) Fix mysql error in db_rev for 22.06.000.064
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P1 - high major (vote)
Assignee: Michael Hafen
QA Contact: Testopia
URL:
Keywords:
: 32497 (view as bug list)
Depends on: 14783
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-14 18:51 UTC by Michael Hafen
Modified: 2023-06-08 22:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.01


Attachments
Proposed fix (1.50 KB, patch)
2022-12-14 18:51 UTC, Michael Hafen
Details | Diff | Splinter Review
Bug 32470: (Bug 14783 follow-up) Fix mysql error in db_rev for 22.06.000.064 (1.53 KB, patch)
2022-12-16 11:38 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Hafen 2022-12-14 18:51:07 UTC
Created attachment 144592 [details] [review]
Proposed fix

The db_rev for 22.06.000.064 throws an error in MySQL:

ERROR 1093 (HY000): You can't specify target table 'systempreferences' for update in FROM clause

Test plan:

install Koha 22.06.0 with db_rev 064 with MySQL database
run koha-upgrade-schema and note MySQL error while processing db_rev 064

apply patch

run koha-upgrade-schema again and note there is no MySQL error for db_rev 064
Comment 1 David Nind 2022-12-16 00:35:19 UTC
I changed the status, as I think it is more than an enhancement.

I will have a go at testing...
Comment 2 David Nind 2022-12-16 00:39:05 UTC
Also (for reference) is a report of this error on the mailing list: https://lists.katipo.co.nz/pipermail/koha/2022-December/058794.html
Comment 3 Tomás Cohen Arazi 2022-12-16 11:38:47 UTC
Created attachment 144669 [details] [review]
Bug 32470: (Bug 14783 follow-up) Fix mysql error in db_rev for 22.06.000.064

Fix MySQL error:
ERROR 1093 (HY000): You can't specify target table 'systempreferences' for
 update in FROM clause

introduced by db_rev 064 for bug 14783.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2022-12-16 12:02:27 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 5 Martin Renvoize 2022-12-18 08:22:28 UTC
Nice work everyone!

Pushed to 22.11.x for the next release
Comment 6 Katrin Fischer 2022-12-19 19:41:53 UTC
*** Bug 32497 has been marked as a duplicate of this bug. ***