Bugzilla – Attachment 51607 Details for
Bug 13669
Web installer fails to load 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.22 KB, created by
Bernardo Gonzalez Kriegel
on 2016-05-19 00:38:53 UTC
(
hide
)
Description:
Bug 13669: (alternative) use DBIx::RunSQL
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2016-05-19 00:38:53 UTC
Size:
3.22 KB
patch
obsolete
>From cc7a24f9da43b160865dc7b8aba41398b2e96e34 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 >--- > 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 13669
:
51596
|
51597
|
51598
|
51599
|
51600
|
51601
|
51607
|
51608
|
51610
|
51611
|
51612
|
51671
|
51672
|
51680
|
51681
|
51682
|
51683
|
51684
|
51685
|
51736
|
51738
|
51746