Bug 29009 - Attempting to Koha-restore shows unnecessary SQL error
Summary: Attempting to Koha-restore shows unnecessary SQL error
Status: RESOLVED DUPLICATE of bug 10517
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: 21.05
Hardware: All All
: P5 - low trivial
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-14 07:45 UTC by Matthew LS
Modified: 2023-08-18 08:48 UTC (History)
2 users (show)

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


Attachments
Patch (from GitHub - https://github.com/Koha-Community/Koha/pull/42.patch) (1.31 KB, patch)
2021-09-14 07:48 UTC, Matthew LS
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew LS 2021-09-14 07:45:31 UTC
`koha-restore` command outputs an error about being unable to drop the user:

`ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_library'@'%'`

This can be avoided by adding `IF EXISTS` to the command (as has been done in [`koha-remove`](https://github.com/Koha-Community/Koha/blob/a5a3a330cfc7c7d6c35db13326745dabf8fe0df3/debian/scripts/koha-remove#L69-70)

Tested on Ubuntu 20.04 LTS with Koha 21.05.02.003 and 21.05.03.001

N.B. This bug was originally filed as a [PR on GitHub](https://github.com/Koha-Community/Koha/pull/42)
Comment 1 Matthew LS 2021-09-14 07:48:07 UTC
Created attachment 124853 [details] [review]
Patch (from GitHub - https://github.com/Koha-Community/Koha/pull/42.patch)
Comment 2 Mike Lake 2021-10-02 06:27:21 UTC
I can confirm that this patch removed that error for me using Debian 11.0 and koha-common 21.05.04-1
Comment 3 Magnus Enger 2023-08-18 08:48:48 UTC
Looks like this was solved by bug 10517.

*** This bug has been marked as a duplicate of bug 10517 ***