[Bug 10185] New: updatedatabase.pl remove all reserves
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Bug ID: 10185 Summary: updatedatabase.pl remove all reserves Classification: Unclassified Change sponsored?: --- Product: Koha Version: 3.10 Hardware: All OS: All Status: ASSIGNED Severity: critical Priority: P5 - low Component: Database Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com Update number 3.09.00.025 can remove all reserves from reserves table when there is no entries in old_reserves. This is due to @ai which is set to NULL in SET @ai = ( SELECT MAX( reserve_id ) FROM tmp_reserves ) and reserve_id > NULL returns no results in INSERT INTO reserves SELECT * FROM tmp_reserves WHERE reserve_id > @ai This can be fixed easily by using COALESCE INSERT INTO reserves SELECT * FROM tmp_reserves WHERE reserve_id > COALESCE(@ai, 0) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 17934 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17934&action=edit Bug 10185: Fix update 3.09.00.025 It can remove all reserves from reserves table when there is no entries in old_reserves. This is due to @ai which is set to NULL in SET @ai = ( SELECT MAX( reserve_id ) FROM tmp_reserves ) and reserve_id > NULL returns no results in INSERT INTO reserves SELECT * FROM tmp_reserves WHERE reserve_id > @ai -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Note that this bug concern version 3.10, but also 3.12 and master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17934|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 17939 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17939&action=edit Bug 10185: Fix update 3.09.00.025 It can remove all reserves from reserves table when there is no entries in old_reserves. This is due to @ai which is set to NULL in SET @ai = ( SELECT MAX( reserve_id ) FROM tmp_reserves ) and reserve_id > NULL returns no results in INSERT INTO reserves SELECT * FROM tmp_reserves WHERE reserve_id > @ai Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Can you please write a test plan for this? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- 1/ Do a fresh 3.8 install 2/ Do some reserves 3/ Check your old_reserves table is empty 4/ Update your sources to 3.10 5/ Run updatedatabase.pl 6/ Your reserves table is now empty! Now repeat steps 1 to 4, then apply the patch and run updatedatabase.pl Your reserves table should still contains the reserves made at step 2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thank you, Julian! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Julian, thx for the test plan. It works as described, but I found something that is weird here - we are losing the suspended holds in the update process. The reserves seem ok, but the suspend_until is empty after the update. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ok, I guess I found it: suspend_until is missing from the update? http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=installer/data/mys... Could you take a look at that and add a follow up? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |blocker --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 2 evil data loss bugs caused by "3.09.00.025" - marking this blocker. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=9891 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff Severity|blocker |critical --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- It seems that 'suspend' is missing too http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=installer/data/mys... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 17958 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17958&action=edit Bug 10185: Add missing columns in update 3.09.00.025 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Good catch, Julian! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |blocker -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.10 |master --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- We will need this fix in all versions that have this database update - setting version to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17973 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17973&action=edit [PASSED QA] Bug 10185: Add missing columns in update 3.09.00.025 Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> SQL only changes fixing an important database update. IMPORTANT: Patches must be backported to all versions containing the database update 3.09.00.025. I used the test plan provided by Julian with some additions: 1/ Do a fresh 3.8 install 2/ Do some reserves 3/ Check your old_reserves table is empty 4/ Update your sources to 3.10 5/ Run updatedatabase.pl 6/ Your reserves table is now empty! I made sure I had item level and title level holds, also suspended holds. I repeated the test with entries in my old_reserves table (cancelled and filled holds) to make sure this is also still working correctly. Before the patch we lost all suspended holds and when the old_reserves table was empty also all holds in general. After the patch the reserve_id is added but the other data in both tables is not altered. NOTE: Adding the reserve_id first to old_reserves and then to reserves we are missing one id in between. old_reserves: 1,2,3 reserves: 5,6 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17939|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17958|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #17973|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off QA Contact| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17974 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17974&action=edit [PASSED QA] Bug 10185: Fix update 3.09.00.025 It can remove all reserves from reserves table when there is no entries in old_reserves. This is due to @ai which is set to NULL in SET @ai = ( SELECT MAX( reserve_id ) FROM tmp_reserves ) and reserve_id > NULL returns no results in INSERT INTO reserves SELECT * FROM tmp_reserves WHERE reserve_id > @ai Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Test plan and comments on second patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 17975 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=17975&action=edit [PASSED QA] Bug 10185: Add missing columns in update 3.09.00.025 Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> SQL only changes fixing an important database update. IMPORTANT: Patches must be backported to all versions containing the database update 3.09.00.025. I used the test plan provided by Julian with some additions: 1/ Do a fresh 3.8 install 2/ Do some reserves 3/ Check your old_reserves table is empty 4/ Update your sources to 3.10 5/ Run updatedatabase.pl 6/ Your reserves table is now empty! I made sure I had item level and title level holds, also suspended holds. I repeated the test with entries in my old_reserves table (cancelled and filled holds) to make sure this is also still working correctly. Before the patch we lost all suspended holds and when the old_reserves table was empty also all holds in general. After the patch the reserve_id is added but the other data in both tables is not altered. NOTE: Adding the reserve_id first to old_reserves and then to reserves we are missing one id in between. old_reserves: 1,2,3 reserves: 5,6 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Treating the second patch as a QA follow up. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #18 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master and 3.12.x. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #19 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x will be in 3.10.6 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=7065 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10185 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Stable |CLOSED Resolution|--- |FIXED --- Comment #20 from Julian Maurice <julian.maurice@biblibre.com> --- Ok in master, 3.12.x and 3.10.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org