[Koha-bugs] [Bug 10517] koha-restore fails to create mysqluser at mysql_hostname so zebra update fails

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 5 17:14:26 CEST 2020


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

Victor Grousset/tuxayo <victor at tuxayo.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |victor at tuxayo.net

--- Comment #17 from Victor Grousset/tuxayo <victor at tuxayo.net> ---
For some reason comment 15 doesn't have the test plan. But it turns out the
patch has a test plan. Here it is, to remove confusion and help discussing it:

Subject: [PATCH] Bug 10517: Use `DROP USER IF EXISTS` and remove ` || true`.

When restoring a Koha instance, and the database user does not exist, an error
is shown,
although it is prevented from stopping the script by ` || true`. This patch
removes the
` || true` guard, and rather uses `DROP USER IF EXISTS` which does exactly what
one
would expect, without confusing error messages, whether the user existed or
not.

To test:
1) Assume your Koha instance is called `asdf`.
1) Export the Koha instance using `koha-dump`.
2) Remove the instance completely using `koha-remove`.
3) Import it again using `koha-restore`.
4) No error should be shown, and the import should work. There was NO user to
drop, therefore `DROP USER IF EXISTS` did nothing.
5) A database user called `koha_asdf` should exist, and have all privileges on
the database of the same name.
6) Remove the instance again using `koha-remove`.
7) Now create a database user in MySQL called `koha_instance` where instance is
the name of your dumped koha instance.
8) Import your koha instance again using `koha-restore`.
9) Again, no error should be shown, and the import should work. There WAS a
user to drop, therefore `DROP USER IF EXISTS` dropped the user before creating
a new one.
10) Again, a database user called `koha_asdf` should exist, and have all
privileges on the database of the same name.

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


More information about the Koha-bugs mailing list