Bugzilla – Attachment 51619 Details for
Bug 16554
Web installer fails to load i18n sample data on MySQL 5.6+
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13669: (alternative) use DBIx::RunSQL
Bug-13669-alternative-use-DBIxRunSQL.patch (text/plain), 3.33 KB, created by
Bernardo Gonzalez Kriegel
on 2016-05-19 13:58:14 UTC
(
hide
)
Description:
Bug 13669: (alternative) use DBIx::RunSQL
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2016-05-19 13:58:14 UTC
Size:
3.33 KB
patch
obsolete
>From 2d1f3e8933c7a912a86080ba9c76b875267b458f Mon Sep 17 00:00:00 2001 >From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Date: Wed, 18 May 2016 16:25:25 -0300 >Subject: [PATCH] Bug 13669: (alternative) use DBIx::RunSQL > >Alternative POC solution, on top of >previous patches, feel free to obsolte. > >This patch use DBIx::RunSQL->run_sql_file >to procees each sql file. > >To test: >1) Apply all patches >2) Same test plan of patch 1 > >Timing test running web installer, marc21, >all sample data, time in seconds > >a) without patch >structure data >59.7 66.5 >58.6 66.0 > >b) SQL::SplitStatement (patch 1+2) >59.4 101 >59.7 102 > >c) DBIx::RunSQL (patch 3) >60.7 66.8 >59.4 66.2 > >Tomas' version is a bit slower loading sample data, >all give similar results processing kohastructure. > >New dependency to package: DBIx::RunSQL > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >https://bugs.koha-community.org/show_bug.cgi?id=16554 >--- > C4/Installer.pm | 18 ++++++------------ > .../mysql/en/optional/marc21_holdings_coded_values.sql | 3 ++- > 2 files changed, 8 insertions(+), 13 deletions(-) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index b239853..54587de 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -20,8 +20,7 @@ package C4::Installer; > use Modern::Perl; > > use Encode qw( encode is_utf8 ); >-use File::Slurp; >-use SQL::SplitStatement; >+use DBIx::RunSQL; > use C4::Context; > use C4::Installer::PerlModules; > use DBI; >@@ -435,17 +434,12 @@ sub load_sql { > > my $dbh = $self->{ dbh }; > >- my $sql = read_file( $filename, binmode => ':utf8'); >- my $sql_splitter = SQL::SplitStatement->new; >- my @statements = $sql_splitter->split($sql); >- my $error = ""; >+ my $error = DBIx::RunSQL->run_sql_file( >+ dbh => $dbh, >+ sql => $filename, >+ ); > >- foreach my $statement ( @statements ) { >- $dbh->do($statement); >- if( $dbh->err) { >- $error .= "$filename (" . $dbh->errstr . "): $statement\n"; >- } >- } >+ $error = ( $error ) ? "ERROR: $filename" : ""; > > return $error; > } >diff --git a/installer/data/mysql/en/optional/marc21_holdings_coded_values.sql b/installer/data/mysql/en/optional/marc21_holdings_coded_values.sql >index adc3ea7..d630b8e 100644 >--- a/installer/data/mysql/en/optional/marc21_holdings_coded_values.sql >+++ b/installer/data/mysql/en/optional/marc21_holdings_coded_values.sql >@@ -3,7 +3,8 @@ > -- Refer to http://www.niso.org/standards/index.html > > -- General Holdings: Type of Unit Designator >-INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('HINGS_UT','0','Information not available; Not applicable');INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('HINGS_UT','a','Basic bibliographic unit'); >+INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('HINGS_UT','0','Information not available; Not applicable'); >+INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('HINGS_UT','a','Basic bibliographic unit'); > INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('HINGS_UT','c','Secondary bibliographic unit: supplements, special issues, accompanying material, other secondary bibliographic units'); > INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('HINGS_UT','d','Indexes'); > >-- >1.9.1
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 16554
:
51619
|
51620
|
51621
|
51752
|
51753
|
51754
|
51755
|
51756
|
51757
|
51840
|
51890
|
51897
|
51898
|
51899
|
51900
|
54136
|
54137
|
54399
|
54404
|
54405
|
54406
|
54407
|
54408
|
54409
|
54410
|
54411
|
54412
|
54413
|
54414
|
54415
|
54416
|
55219
|
55220
|
55221
|
55222
|
55223
|
55224
|
55225
|
55226
|
55227
|
55228
|
55229
|
55230