Bugzilla – Attachment 35370 Details for
Bug 13068
New feature for DB update and sandbox
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13068: Raise an error if a pl script has a sql error
Bug-13068-Raise-an-error-if-a-pl-script-has-a-sql-.patch (text/plain), 2.01 KB, created by
Marcel de Rooy
on 2015-01-19 10:35:21 UTC
(
hide
)
Description:
Bug 13068: Raise an error if a pl script has a sql error
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-01-19 10:35:21 UTC
Size:
2.01 KB
patch
obsolete
>From 14f674f1aa3d5dcc374822f75fa9540bbd1ea8d1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 5 Jan 2015 17:03:23 +0100 >Subject: [PATCH] Bug 13068: Raise an error if a pl script has a sql error >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested with some perl and sql dev updates. Checked the list of dev updates >for the TRACK mode. >Slightly amended the patch for printing the error message. Also the message >now may tell you that a dev update failed. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > installer/data/mysql/updatedatabase.pl | 12 ++++++++---- > 1 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 812b224..137068c 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9745,12 +9745,16 @@ 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; >+ my $msg= $@? "ERROR: $@": ($!? "ERROR: $!\n": ''); >+ chomp $msg; >+ print "$msg\n" if $msg; >+ $rv = 1 if !$msg; #apparently, the file does not end with 1; > } >+ $dbh->{RaiseError} = 0; > } elsif( $file =~ /\.sql$/ ) { > #Run sql file via installer > my $installer = C4::Installer->new(); >@@ -9762,7 +9766,7 @@ sub ExecDBRev { > } > > if( $devrun ) { >- print "Dev upgrade $file done\n"; >+ print "Dev upgrade $file ".( $rv? 'done': 'failed' )."\n"; > _atomic_memory( $atomicupd, $file ) if $rv; > } else { > _atomic_memory( $atomicupd ); #Official dbrev may clear atomic pref >-- >1.7.7.6
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 13068
:
32173
|
32174
|
32175
|
32177
|
32178
|
32179
|
32180
|
32185
|
32294
|
32300
|
32398
|
32399
|
32525
|
32526
|
32658
|
32659
|
32784
|
32785
|
32839
|
32840
|
32841
|
32842
|
32843
|
32919
|
32921
|
33859
|
34070
|
34071
|
34072
|
34949
|
34950
|
34951
|
34960
|
34998
|
35000
|
35001
|
35002
|
35003
|
35366
|
35367
|
35368
|
35370
|
36716
|
36717
|
36718
|
36719
|
36779
|
36780
|
36781
|
36792
|
37061
|
37062
|
37063
|
37064
|
37065
|
37066
|
37075
|
37076
|
37491