Bugzilla – Attachment 100094 Details for
Bug 24741
Recent creation of unique index on library_groups erroneously removes rows
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017
Bug-24741-bug-21674-follow-up-Fix-destructive-upda.patch (text/plain), 1.92 KB, created by
Nick Clemens (kidclamp)
on 2020-03-04 10:51:25 UTC
(
hide
)
Description:
Bug 24741: (bug 21674 follow-up) Fix destructive update DB 19.12.00.017
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-03-04 10:51:25 UTC
Size:
1.92 KB
patch
obsolete
>From d2f66c4245881238615f6a356122f49031cc2028 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 3 Mar 2020 09:55:03 +0100 >Subject: [PATCH] Bug 24741: (bug 21674 follow-up) Fix destructive update DB > 19.12.00.017 > >Previous version of the SQL query did not deal correctly with subgroup. > >Test plan: >checkout the following commit to be just before 017 > commit 715da06db557edc4b1baa51cc278fdac362c01c4 > Bug 22868: DBRev 19.12.00.016 >reset_all # recreate the DB >Create a complex tree of library groups, with several groups, subgroups, >etc. >When you add a new library, refresh the page to add it several time. >When ready, git checkout master, restart all the things, execute the >updatedatabase script, then go to the library groups page. >You should see that the duplicated entries have been removed, but >subgroups have not been deleted > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Tested with duplicated entries on groups and subgroups, >going back to the right commit and doing clean install. >Patch works, subgroups are preserved. No errors. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > installer/data/mysql/updatedatabase.pl | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index df895366e2..764860c1a3 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -20668,10 +20668,9 @@ if( CheckVersion( $DBversion ) ) { > WHERE id NOT IN ( > SELECT MIN(id) > FROM ( SELECT * FROM library_groups ) AS lg >- WHERE parent_id IS NOT NULL > GROUP BY parent_id, branchcode > ) >- AND parent_id IS NOT NULL; >+ AND NOT(parent_id IS NULL OR branchcode IS NULL); > |); > $dbh->do(q| > ALTER TABLE library_groups >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24741
:
99978
|
100041
| 100094