[Bug 13523] New: AddBiblio fails on mysql with STRICT_TRANS_TABLES
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Bug ID: 13523 Summary: AddBiblio fails on mysql with STRICT_TRANS_TABLES Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Cataloging Assignee: gmcharlt@gmail.com Reporter: benjamin.rokseth@kul.oslo.kommune.no QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Adding a biblio either via /svc endpoint or via Cataloguing interface fails on mysql versions > 5.3.21 because of a change in the default settings in GLOBAL.sql_mode to add STRICT_TRANS_TABLES. when adding a biblio in Cataloguing or via /svc API: --- Software error: Can't call method "fields" on an undefined value at /usr/share/koha/intranet/cgi-bin/cataloguing/additem.pl line 683. --- Doing this manually in SQL results in: --- ERROR 1364 (HY000): Field 'marcxml' doesn't have a default value --- This is probably a change that will live (Mysql becomes stricter in v5.7) and is purposefully added to better handle syntax checks in the SQL. bugs #10732, #5366 and #10215 all relate to the same but do not propose a fix. This particular bug proposes to fix the particular issue with adding biblios, either by 1) changing the database schema to NOT set field `marcxml` to NOT NULL (field `marc` in the same table is NULLABLE) 2) changing the AddBiblio code in Biblio.pm so it doesn't require multiple INSERT statements -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 koha@akafred.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@akafred.com --- Comment #1 from koha@akafred.com --- (In reply to Benjamin Rokseth from comment #0)
on mysql versions > 5.3.21
This should be 'on mysql versions > 5.6.21'. (not 5.3.21) 5.6.22 is the current stable version of mysql - released 2014-12-01: http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-22.html -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- I think the changing the constraint is the best solution here. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #3 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- (In reply to Chris Cormack from comment #2)
I think the changing the constraint is the best solution here.
If by this you mean removing the NOT NULL constraint on the marcxml field (as is the case with the marc field) we agree on the most reasonable solution. Hope this does not affect any other part of Koha. Will include a patch soon. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #4 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 35456 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35456&action=edit Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES This patch removes the NOT NULL restriction on biblioitems.marcxml and deletedbiblioitems.marcxml due to STRICT_TRANS_TABLES default in Mysql 5.6.22 and onwards. Test: 1. check mysql global settings: mysql > SELECT @@GLOBAL.sql_mode; verify that STRICT_TRANS_TABLES is not set 2. set STRICT_TRANS_TABLES (or upgrade mysql to > 5.6.21) mysql > SET @@GLOBAL.sql_mode = 'STRICT_TRANS_TABLES'; 3. try to add biblio in Cataloguing module verify that it fails with a "software error" 4. apply patch 5. repeat 3 and verify that there is no "software error" any more -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Isabela Terra <isabelaterra@cp2.g12.br> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |isabelaterra@cp2.g12.br Status|Needs Signoff |Failed QA --- Comment #5 from Isabela Terra <isabelaterra@cp2.g12.br> --- (In reply to Benjamin Rokseth from comment #4)
Created attachment 35456 [details] [review] Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES
This patch removes the NOT NULL restriction on biblioitems.marcxml and deletedbiblioitems.marcxml due to STRICT_TRANS_TABLES default in Mysql 5.6.22 and onwards.
Test:
1. check mysql global settings: mysql > SELECT @@GLOBAL.sql_mode; verify that STRICT_TRANS_TABLES is not set 2. set STRICT_TRANS_TABLES (or upgrade mysql to > 5.6.21) mysql > SET @@GLOBAL.sql_mode = 'STRICT_TRANS_TABLES'; 3. try to add biblio in Cataloguing module verify that it fails with a "software error" 4. apply patch 5. repeat 3 and verify that there is no "software error" any more
Hello, I applied these changes but the error continues. Is there anything else for me to do? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Isabela Terra <isabelaterra@cp2.g12.br> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |RESOLVED Resolution|--- |FIXED --- Comment #6 from Isabela Terra <isabelaterra@cp2.g12.br> --- (In reply to Isabela Terra from comment #5)
(In reply to Benjamin Rokseth from comment #4)
Created attachment 35456 [details] [review] [review] Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES
This patch removes the NOT NULL restriction on biblioitems.marcxml and deletedbiblioitems.marcxml due to STRICT_TRANS_TABLES default in Mysql 5.6.22 and onwards.
Test:
1. check mysql global settings: mysql > SELECT @@GLOBAL.sql_mode; verify that STRICT_TRANS_TABLES is not set 2. set STRICT_TRANS_TABLES (or upgrade mysql to > 5.6.21) mysql > SET @@GLOBAL.sql_mode = 'STRICT_TRANS_TABLES'; 3. try to add biblio in Cataloguing module verify that it fails with a "software error" 4. apply patch 5. repeat 3 and verify that there is no "software error" any more
Hello, I applied these changes but the error continues. Is there anything else for me to do?
Resolved! Thanks! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #7 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- yes, I believe I forgot to mention that updatedatabase.pl must be run if you already have a running koha instance -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |--- Status|RESOLVED |REOPENED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #8 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Isabela, would you care to sign off if you tested and it worked according to the description? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #9 from Isabela Terra <isabelaterra@cp2.g12.br> --- (In reply to Benjamin Rokseth from comment #8)
Isabela, would you care to sign off if you tested and it worked according to the description?
Yes, i can do this! How? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #10 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- (In reply to Isabela Terra from comment #9)
(In reply to Benjamin Rokseth from comment #8)
Isabela, would you care to sign off if you tested and it worked according to the description?
Yes, i can do this! How?
You can do it from within bugzilla. Describe in short what you did to confirm it worked. Then change status to Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bob-ewart@bobsown.com --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- *** Bug 13711 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Jonathan Druart <jonathan.druart@biblibre.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=13523 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35456|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 35932 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35932&action=edit Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES This patch removes the NOT NULL restriction on biblioitems.marcxml and deletedbiblioitems.marcxml due to STRICT_TRANS_TABLES default in Mysql 5.6.22 and onwards. Test: 1. check mysql global settings: mysql > SELECT @@GLOBAL.sql_mode; verify that STRICT_TRANS_TABLES is not set 2. set STRICT_TRANS_TABLES (or upgrade mysql to > 5.6.21) mysql > SET @@GLOBAL.sql_mode = 'STRICT_TRANS_TABLES'; 3. try to add biblio in Cataloguing module verify that it fails with a "software error" 4. apply patch 5. repeat 3 and verify that there is no "software error" any more Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> I confirm with the problem with mariadb and STRICT_TRANS_TABLES enabled. On adding a biblio (C4::Biblio::AddBiblio), biblioitems is populate in _koha_add_biblioitem but marxcml is not generated yet. It's in ModBiblioMarc, few lines later. The NOT NULL condition is not valid here. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Assignee|gmcharlt@gmail.com |benjamin.rokseth@kul.oslo.k | |ommune.no CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=5366 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #13 from Jonathan Druart <jonathan.druart@biblibre.com> --- Same problem could happen on the import_records table, see bug 5366. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #14 from Bob Ewart <bob-ewart@bobsown.com> --- auth_header, import_items and import_records all have marcxml set as NOT NULL, marcxml_old in import_records is also. New from Z39.50/SRU fails ever time on marcxml_old does not have a default value. Removing the restriction make it work. I'm using Mariadb 10.0.13 on openSUSE 13.2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35932|0 |1 is obsolete| | --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 36087 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36087&action=edit [PASSED QA] Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES This patch removes the NOT NULL restriction on biblioitems.marcxml and deletedbiblioitems.marcxml due to STRICT_TRANS_TABLES default in Mysql 5.6.22 and onwards. Test: 1. check mysql global settings: mysql > SELECT @@GLOBAL.sql_mode; verify that STRICT_TRANS_TABLES is not set 2. set STRICT_TRANS_TABLES (or upgrade mysql to > 5.6.21) mysql > SET @@GLOBAL.sql_mode = 'STRICT_TRANS_TABLES'; 3. try to add biblio in Cataloguing module verify that it fails with a "software error" 4. apply patch 5. repeat 3 and verify that there is no "software error" any more Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> I confirm with the problem with mariadb and STRICT_TRANS_TABLES enabled. On adding a biblio (C4::Biblio::AddBiblio), biblioitems is populate in _koha_add_biblioitem but marxcml is not generated yet. It's in ModBiblioMarc, few lines later. The NOT NULL condition is not valid here. 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=13523 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 36146 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36146&action=edit Bug 13523: DBIC updates Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Benjamin! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #18 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x will be in 3.18.5 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #19 from Mason James <mtj@kohaaloha.com> --- Pushed to 3.16.x, will be in 3.16.9 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Stephen Warren <swarren@wwwdotorg.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |swarren@wwwdotorg.org --- Comment #20 from Stephen Warren <swarren@wwwdotorg.org> --- I have 3.18.05.1 installed from your dpkg repo, so I think I have this fix:
# dpkg -l koha-common ii koha-common 3.18.05.1 all integrated (physical) library management system
I'm still seeing this error when editing items (as reported by my user; I can get more details exactly which edit page she's using if needed). I checked my database and as far as I can tell, the DB schema patch has been applied:
mysql> show columns from biblioitems; | Field | Type | Null | Key | Default | Extra | ... | marcxml | longtext | YES | | NULL | |
Was the "edit" use-case not covered by the patch, or is there something else I should look at to track down the issue? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #21 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Stephen, I was not able to reproduce your issue. Looking at your schema the marcxml row looks ok. Are you able to get a detailed description of the issue? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolyn.somers@biblibre.co | |m --- Comment #22 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14, will be in 3.14.15. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13523 --- Comment #23 from Stephen Warren <swarren@wwwdotorg.org> --- The issue I mentioned in comment 20 here was caused by user error. For the record, when I modified my koha-conf.xml to add some lines to fix bug 13396, I didn't realize that the __xxx__ values needed to be replaced with their actual values. It seems there are some fields that contain __xxx__ after koha-create and some that don't... After fixing that and rebuilding the search index, everything seems to be working again. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org