parallel: Fixed SQL racing error.

If two workers both work on the last job, the master will drop the
table when the first returns. The second should ignore the dropped
table.
This commit is contained in:
Ole Tange 2016-07-10 23:01:53 +02:00
parent 29a7113d7f
commit 1117140adb

View file

@ -10194,7 +10194,8 @@ sub get {
my $self = shift; my $self = shift;
my $sth = $self->run(@_); my $sth = $self->run(@_);
my @retval; my @retval;
while(1) { # If $sth = 0 it means the table was dropped by another process
while($sth) {
my @row = $sth->fetchrow_array(); my @row = $sth->fetchrow_array();
@row or last; @row or last;
push @retval, \@row; push @retval, \@row;