From 1117140adb06790ed8b0beb8b680fc6207d461a0 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 10 Jul 2016 23:01:53 +0200 Subject: [PATCH] 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. --- src/parallel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parallel b/src/parallel index 4c62232e..a0f80a54 100755 --- a/src/parallel +++ b/src/parallel @@ -10194,7 +10194,8 @@ sub get { my $self = shift; my $sth = $self->run(@_); my @retval; - while(1) { + # If $sth = 0 it means the table was dropped by another process + while($sth) { my @row = $sth->fetchrow_array(); @row or last; push @retval, \@row;