Bugzilla – Attachment 36087 Details for
Bug 13523
AddBiblio fails on mysql with STRICT_TRANS_TABLES
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES
PASSED-QA-Bug-13523---AddBiblio-fails-on-mysql-wit.patch (text/plain), 3.52 KB, created by
Kyle M Hall (khall)
on 2015-02-20 14:22:21 UTC
(
hide
)
Description:
[PASSED QA] Bug 13523 - AddBiblio fails on mysql with STRICT_TRANS_TABLES
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-02-20 14:22:21 UTC
Size:
3.52 KB
patch
obsolete
>From 2173717c021346e632f8fe2a851051b37f70d9c7 Mon Sep 17 00:00:00 2001 >From: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> >Date: Thu, 22 Jan 2015 12:21:47 +0100 >Subject: [PATCH] [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> >--- > installer/data/mysql/kohastructure.sql | 4 ++-- > installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ > 2 files changed, 16 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index cd83f99..08ef9ee 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -181,7 +181,7 @@ CREATE TABLE `biblioitems` ( -- information related to bibliographic records in > `cn_sort` varchar(255) default NULL, -- normalized version of the call number used for sorting > `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a) > `totalissues` int(10), >- `marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML >+ `marcxml` longtext, -- full bibliographic MARC record in MARCXML > PRIMARY KEY (`biblioitemnumber`), > KEY `bibinoidx` (`biblioitemnumber`), > KEY `bibnoidx` (`biblionumber`), >@@ -812,7 +812,7 @@ CREATE TABLE `deletedbiblioitems` ( -- information about bibliographic records t > `cn_sort` varchar(255) default NULL, -- normalized version of the call number used for sorting > `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a) > `totalissues` int(10), >- `marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML >+ `marcxml` longtext, -- full bibliographic MARC record in MARCXML > PRIMARY KEY (`biblioitemnumber`), > KEY `bibinoidx` (`biblioitemnumber`), > KEY `bibnoidx` (`biblionumber`), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 47930ab..461793f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9779,6 +9779,20 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.19.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ ALTER TABLE biblioitems MODIFY COLUMN marcxml longtext >+ }); >+ >+ $dbh->do(q{ >+ ALTER TABLE deletedbiblioitems MODIFY COLUMN marcxml longtext >+ }); >+ >+ print "Upgrade to $DBversion done (Bug 13523 - Remove NOT NULL restriction on field marcxml due to mysql STRICT_TRANS_TABLES)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.2.5
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 13523
:
35456
|
35932
| 36087 |
36146