[Bug 21682] New: Stock Rotation: Update DB is failing with strict_sql_modes ON
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Bug ID: 21682 Summary: Stock Rotation: Update DB is failing with strict_sql_modes ON Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org As pointed out in comment 369 in bug 11897 the db update isn't strict modes correct. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |critical -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81280 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81280&action=edit Bug 21682: Corrections for strict sql in stockrotationrotas Test Plan: 1) Ensure you're database is prior to version 18.06.00.040 2) Ensure 'strict_sql_modes' is enabled 3) Run updatedatabase 4) See no errors during upgrade 5) Run a fresh install 6) Note no errors during database installation -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- As astutely pointed out by Jonathan... the fix appears to be simple, patch submitted. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |11897 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11897 [Bug 11897] Stock Rotation for Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21656 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21656 [Bug 21656] Syntax Error in Stock Rotation Default Notice Template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- You should update existing [dev] installs as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|critical |major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 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> --- As the devs refresh the dbs quite frequently, shoudl this be blocker? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #4)
As the devs refresh the dbs quite frequently, shoudl this be blocker?
Either we need it or we write that somewhere in the guidelines :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81347 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81347&action=edit Bug 21683: (follow-up) - DBUpdate for Dev installs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm not 100% sure on the idempotency of the atomicupdate.. I believe 'DROP DEFAULT' is idempotent in itself, but couldn't find any documentation either way and it's not trivial to check that a DEFAULT constraint exists before attempting to drop it... open to advise here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81347|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81348 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81348&action=edit Bug 21683: (follow-up) - DBUpdate for Dev installs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Actually.. I do need help here.. When running in SQL strict mode I get the following for the atomic update. DBD::mysql::db do failed: BLOB/TEXT column 'description' can't have a default value [for Statement "ALTER TABLE `stockrotationrotas` ALTER COLUMN `description` DROP DEFAULT"] at (eval 1403) line 3. I think we need to check for sql strict mode before attempting to apply the update or not.. :( This was meant to be a simple fix :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Actually.. I get that error whether I enable strict modes or not.. I have no idea. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This should be fixed on the DBRev, no point spending this much time for a simple fix. Specially if the engine rejects 'fixing' the DB structure. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #12 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 81525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81525&action=edit Bug 21682: Prequel addition of default_exists prove t/db_dependent/Installer.t perldoc C4::Installer -- There should be something for default_exists -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81280|0 |1 is obsolete| | Attachment #81348|0 |1 is obsolete| | Attachment #81525|0 |1 is obsolete| | --- Comment #13 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 81526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81526&action=edit Bug 21682: Prequel addition of default_exists prove t/db_dependent/Installer.t perldoc C4::Installer -- There should be something for default_exists -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #14 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 81527 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81527&action=edit Bug 21682: Corrections for strict sql in stockrotationrotas Test Plan: 1) Ensure you're database is prior to version 18.06.00.040 2) Ensure 'strict_sql_modes' is enabled 3) Run updatedatabase 4) See no errors during upgrade 5) Run a fresh install 6) Note no errors during database installation Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #15 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 81528 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81528&action=edit Bug 21682: (follow-up) - DBUpdate for Dev installs https://bugs.koha-community.org/show_bug.cgi?id=21682 Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #16 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 81529 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81529&action=edit Bug 21682: Follow up to use the default_exists check This will make sure it is idempotent, and avoid issues if the DB has already been corrected either through upgrade or manually before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Wow.. thanks M.Tompsett -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Why do not you use the same statement we always use? :) ALTER TABLE stockrotationrotas CHANGE COLUMN description description text; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I wasn't aware that was a statement 'we always use' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81526|0 |1 is obsolete| | Attachment #81527|0 |1 is obsolete| | Attachment #81528|0 |1 is obsolete| | Attachment #81529|0 |1 is obsolete| | --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81769 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81769&action=edit Bug 21682: Corrections for strict sql in stockrotationrotas Test Plan: 1) Ensure you're database is prior to version 18.06.00.040 2) Ensure 'strict_sql_modes' is enabled 3) Run updatedatabase 4) See no errors during upgrade 5) Run a fresh install 6) Note no errors during database installation Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81770&action=edit Bug 21682: Add update DB entry for existing installs -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I removed the need of the new subroutine, could you please test this version? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81769|0 |1 is obsolete| | --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81787&action=edit Bug 21682: Corrections for strict sql in stockrotationrotas Test Plan: 1) Ensure you're database is prior to version 18.06.00.040 2) Ensure 'strict_sql_modes' is enabled 3) Run updatedatabase 4) See no errors during upgrade 5) Run a fresh install 6) Note no errors during database installation Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81770|0 |1 is obsolete| | --- Comment #24 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 81788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81788&action=edit Bug 21682: Add update DB entry for existing installs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works for me -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #81788|0 |1 is obsolete| | --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 81815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=81815&action=edit Bug 21682: Add update DB entry for existing installs Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #27 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I amended the last patch to move atomicupdate/bug_21620.perl to atomicupdate/bug_21682.perl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #28 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #29 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Bug 11897 not in 18.05.x series. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #26)
Created attachment 81815 [details] [review] Bug 21682: Add update DB entry for existing installs
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch removed the NOT NULL from the title field at upgrade time. WIll open a report for it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21682 --- Comment #31 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #30)
(In reply to Jonathan Druart from comment #26)
Created attachment 81815 [details] [review] [review] Bug 21682: Add update DB entry for existing installs
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This patch removed the NOT NULL from the title field at upgrade time. WIll open a report for it.
Description field -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org