@@ -, +, @@ --- C4/Installer.pm | 18 ++++++------------ .../mysql/en/optional/marc21_holdings_coded_values.sql | 3 ++- 2 files changed, 8 insertions(+), 13 deletions(-) --- a/C4/Installer.pm +++ a/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; } --- a/installer/data/mysql/en/optional/marc21_holdings_coded_values.sql +++ a/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'); --