Created attachment 9030 [details] [review] koha-remove change I used as a workaround root:~# koha-remove library Removing Koha instance -- ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_--'@'%' root:~# The koha-remove shell script aborts upon this attempt. It has a list consisting of -- and 'library', and does not get so far as to attempt 'library'. I worked around this by saving the original value of "$@" because it appeared to me that "set -- $args" was corrupting the subsequent use of "$@". See attached patch. Debian squeeze, bash 4.1-3
Adding Robin (package maintainer) in CC.
That's strange that the set would corrupt that. Off the top of my head, I'm not sure what would be going on there.
Created attachment 9366 [details] [review] Bug 7924 - Fix handling of command line arguments in koha-remove koha-remove would fail with a message like this: Removing Koha instance -- ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_--'@'%' After fixing this, the --keep-mysql option made the script exit without doing anything. To test: Alt 1 - Build package with build-git-snapshot - Install package Alt 2 - Replicate the changes in the patch in an existing installation Then: - Add instance1 and instance2 - koha-remove instance1 -- Check that script completes and the databse is gone - koha-remove --keep-mysql instance2 -- Check that the script completes but the database is not removed
Created attachment 9456 [details] [review] Bug 7924 - Fix handling of command line arguments in koha-remove koha-remove would fail with a message like this: Removing Koha instance -- ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_--'@'%' After fixing this, the --keep-mysql option made the script exit without doing anything. To test: Alt 1 - Build package with build-git-snapshot - Install package Alt 2 - Replicate the changes in the patch in an existing installation Then: - Add instance1 and instance2 - koha-remove instance1 -- Check that script completes and the databse is gone - koha-remove --keep-mysql instance2 -- Check that the script completes but the database is not removed Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This bug will be included in the Koha 3.6.5 release. Incorporated into stable prior to inclusion in master because the patch is required for the release process.
Can we get this through qa please it is needed for the 3.8.1 releaae
Only affects packages, and the changes look simple enough: add an eval, then move the exit line separate from the mysql command. Marking Passed QA.
This fix will be in 3.8.1