]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Executive DB retry: Avoid an undefined warning
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 17 Dec 2015 13:27:30 +0000 (13:27 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 5 Jan 2016 17:46:12 +0000 (17:46 +0000)
If something other than the DB statements inside need_retry throws an
exception, ->err will normally be undef (because
$dbh_tests->begin_work will clear it, if nothing else).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/JobDB/Executive.pm

index 6fb77a411267e9e730502a67f2baa9d0a835d53b..c0af21c457d91b94e6af3944bf832fa428ee7613 100644 (file)
@@ -50,7 +50,7 @@ sub begin_work ($$$) { #method
 sub need_retry ($$$) {
     my ($jd, $dbh,$committing) = @_;
     return
-       $dbh_tests->err()==7 &&
+       ($dbh_tests->err() // 0)==7 &&
        ($dbh_tests->state =~ m/^40P01/); # DEADLOCK DETECTED
 }