Bugzilla – Attachment 13384 Details for
Bug 5366
Koha does not work right with MariaDB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[2/2] Bug 5366 - Standing enh req for code changes enabling database agnosticism
22-Bug-5366---Standing-enh-req-for-code-changes-en.patch (text/plain), 3.68 KB, created by
Chris Nighswonger
on 2012-11-12 03:07:33 UTC
(
hide
)
Description:
[2/2] Bug 5366 - Standing enh req for code changes enabling database agnosticism
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2012-11-12 03:07:33 UTC
Size:
3.68 KB
patch
obsolete
>From 8dacf1d8e601518257b197add3c9f40e9c779904 Mon Sep 17 00:00:00 2001 >From: Chris Nighswonger <cnighswonger@foundations.edu> >Date: Thu, 4 Nov 2010 16:19:05 -0400 >Subject: [PATCH] [2/2] Bug 5366 - Standing enh req for code changes enabling > database agnosticism >Content-Type: text/plain; charset="utf-8" > > 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/ImportBatch.pm | 12 ++++-------- > tools/stage-marc-import.pl | 9 ++++++++- > 2 files changed, 12 insertions(+), 9 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index f5b42a9..b852038 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -1128,13 +1128,11 @@ sub SetImportRecordMatches { > > sub _create_import_record { > my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random) = @_; >- >+ my $marcxml_old = " "; # placeholder because import_records.marcxml_old is NOT NULL with no DEFAULT set > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, >- record_type, encoding, z3950random) >- VALUES (?, ?, ?, ?, ?, ?, ?)"); >- $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml(), >- $record_type, $encoding, $z3950random); >+ my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, marcxml_old, record_type, encoding, z3950random) >+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)"); >+ $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml(), $marcxml_old, $record_type, $encoding, $z3950random); > my $import_record_id = $dbh->{'mysql_insertid'}; > $sth->finish(); > return $import_record_id; >@@ -1152,7 +1150,6 @@ sub _update_import_record_marc { > > sub _add_biblio_fields { > my ($import_record_id, $marc_record) = @_; >- > my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record); > my $dbh = C4::Context->dbh; > # FIXME no controlnumber, originalsource >@@ -1160,7 +1157,6 @@ sub _add_biblio_fields { > my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)"); > $sth->execute($import_record_id, $title, $author, $isbn, $issn); > $sth->finish(); >- > } > > sub _update_biblio_fields { >diff --git a/tools/stage-marc-import.pl b/tools/stage-marc-import.pl >index b113332..1793aa5 100755 >--- a/tools/stage-marc-import.pl >+++ b/tools/stage-marc-import.pl >@@ -25,7 +25,12 @@ > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > > use strict; >-#use warnings; FIXME - Bug 2505 >+use warnings; >+ >+#use Sys::Syslog; #XXX >+#openlog('Koha_Import','' ,'LOCAL0'); >+ >+#syslog('debug|local0', "Starting up tools/stage-marc-import.pl"); #XXX > > # standard or CPAN modules used > use CGI; >@@ -129,6 +134,8 @@ if ($completedJobID) { > > } > >+ # open STDERR, '>', "/home/koha/koha.git/var/log/koha-import.log"; # uncomment to log errors from child process; fix path for your install; logfile must be owned by apache user >+ > # FIXME branch code > my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($syntax, $marcrecord, $filename, > $comments, '', $parse_items, 0, >-- >1.7.9.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 5366
:
13383
|
13384
|
13478
|
13479
|
13480