From 12076d4206cd497c74fb5d6483b785cdb19774ed Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 5 Jan 2015 17:03:23 +0100 Subject: [PATCH] Bug 13068: Raise an error if a pl script has a sql error --- installer/data/mysql/updatedatabase.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 08cb721..31b37dc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9732,12 +9732,15 @@ sub ExecDBRev { $rv = 1; } elsif( $file =~ /\.pl$/ ) { #Run perl script + my $dbh = C4::Context->dbh; + $dbh->{RaiseError} = 1; $rv = do $atomicupd->{location}. "/$file"; if( !$rv ) { print "ERROR: $@\n" if $@; print "ERROR: $!\n" if $! && !$@; $rv = 1 if !$! && !$@; #apparently, the file does not end with 1; } + $dbh->{RaiseError} = 0; } elsif( $file =~ /\.sql$/ ) { #Run sql file via installer my $installer = C4::Installer->new(); -- 2.1.0