From 9e208a0ed47bd7574c8b9945afb55776f6c7caa8 Mon Sep 17 00:00:00 2001
From: Chris Nighswonger <cnighswonger@foundations.edu>
Date: Thu, 4 Nov 2010 14:05:29 -0400
Subject: [PATCH] Bug 5366 - Standing enh req for code changes enabling database agnosticism
Content-Type: text/plain; charset="utf-8"
http://koha-community.org

MariaDB apparently will not fudge when one attempts to insert a null value into a
NOT NULL field with no default defined. This probably should have been fixed in
any case, but must be fixed if Koha is to run over MariaDB.

This patch simple supplies a single blank space as the value passed in on the
initial insert.
---
 C4/Biblio.pm |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index eb213d5..9924310 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -3391,7 +3391,7 @@ Internal function to add a biblioitem
 sub _koha_add_biblioitem {
     my ( $dbh, $biblioitem ) = @_;
     my $error;
-
+    my $marcxml = " ";
     my ($cn_sort) = GetClassSort( $biblioitem->{'biblioitems.cn_source'}, $biblioitem->{'cn_class'}, $biblioitem->{'cn_item'} );
     my $query = "INSERT INTO biblioitems SET
         biblionumber    = ?,
@@ -3425,6 +3425,7 @@ sub _koha_add_biblioitem {
         totalissues     = ?,
         ean             = ?,
         agerestriction  = ?
+        marcxml         = ?
         ";
     my $sth = $dbh->prepare($query);
     $sth->execute(
@@ -3435,7 +3436,7 @@ sub _koha_add_biblioitem {
         $biblioitem->{'pages'},            $biblioitem->{'bnotes'},           $biblioitem->{'size'},                  $biblioitem->{'place'},
         $biblioitem->{'lccn'},             $biblioitem->{'marc'},             $biblioitem->{'url'},                   $biblioitem->{'biblioitems.cn_source'},
         $biblioitem->{'cn_class'},         $biblioitem->{'cn_item'},          $biblioitem->{'cn_suffix'},             $cn_sort,
-        $biblioitem->{'totalissues'},      $biblioitem->{'ean'},              $biblioitem->{'agerestriction'}
+        $biblioitem->{'totalissues'},      $biblioitem->{'ean'},              $biblioitem->{'agerestriction'}, $marcxml
     );
     my $bibitemnum = $dbh->{'mysql_insertid'};
 
-- 
1.7.2.5