[Bug 18058] New: 'borrowers-force-messaging-defaults --doit --truncate ' gives DBI error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Bug ID: 18058 Summary: 'borrowers-force-messaging-defaults --doit --truncate ' gives DBI error Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Command-line Utilities Assignee: gmcharlt@gmail.com Reporter: mtj@kohaaloha.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz here's the error on a 16.05.09 pkg install # koha-shell -c ' perl /usr/share/koha/bin/maintenance/borrowers-force-messaging-defaults --doit --truncate ' demo DBD::mysql::st execute failed: Cannot truncate a table referenced in a foreign key constraint (`koha_demo`.`borrower_message_transport_preferences`, CONSTRAINT `borrower_message_transport_preferences_ibfk_1` FOREIGN KEY (`borrower_message_preference_id`) REFERENCES `koha_demo`.`borrower) [for Statement "TRUNCATE borrower_message_preferences"] at /usr/share/koha/bin/maintenance/borrowers-force-messaging-defaults line 52. note: i haven't confirmed this on newer versions, yet -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|mtj@kohaaloha.com |jonathan.druart@bugs.koha-c | |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 60202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60202&action=edit Bug 18058: Allow borrower_message_preferences to be truncated borrower_message_preferences cannot be truncated because of the foreign. DBMS fails with "Cannot truncate a table referenced in a foreign key constraint" To avoid that we should remove the FK check and truncate the other table as well. I am wondering if we really need a truncate here DELETE FROM borrower_message_preferences; should do the job, but leave it as it because of the param name. Test plan perl misc/maintenance/borrowers-force-messaging-defaults --doit --truncate Should no longer raise the error message -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 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=18058 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60202|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 60479 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60479&action=edit [SIGNED-OFF] Bug 18058: Allow borrower_message_preferences to be truncated borrower_message_preferences cannot be truncated because of the foreign. DBMS fails with "Cannot truncate a table referenced in a foreign key constraint" To avoid that we should remove the FK check and truncate the other table as well. I am wondering if we really need a truncate here DELETE FROM borrower_message_preferences; should do the job, but leave it as it because of the param name. Test plan perl misc/maintenance/borrowers-force-messaging-defaults --doit --truncate Should no longer raise the error message 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=18058 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 60985 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60985&action=edit Bug 18058: Allow borrower_message_preferences to be truncated borrower_message_preferences cannot be truncated because of the foreign. DBMS fails with "Cannot truncate a table referenced in a foreign key constraint" To avoid that we should remove the FK check and truncate the other table as well. I am wondering if we really need a truncate here DELETE FROM borrower_message_preferences; should do the job, but leave it as it because of the param name. Test plan perl misc/maintenance/borrowers-force-messaging-defaults --doit --truncate Should no longer raise the error message Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #60479|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Delete instead of truncate indeed seems to be a better idea here.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Pushed to Master |Pushed to Stable --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This patch has been pushed to 16.11.x and will be in 16.11.07. Could not reproduce the error before the patch, but it seems better with it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x for 3.22.20 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18058 --- Comment #8 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.12 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org