Can only SKIP LOCKED if locking rows. Remove FOR SHARE as it isn't supported on < mysql 8

This commit is contained in:
Isaac Connor 2021-12-14 13:33:00 -05:00
parent cca7953856
commit 4fa804e9a2
1 changed files with 4 additions and 6 deletions

View File

@ -413,13 +413,11 @@ sub Sql {
$sql .= ' LIMIT 0,'.$filter_expr->{limit};
}
if ($$self{LockRows}) {
$sql .= ' FOR UPDATE OF E'
} else {
$sql .= ' FOR SHARE OF E'
}
$sql .= ' FOR UPDATE'
if ($filter_expr->{skip_locked}) {
$sql .= ' SKIP LOCKED';
}
}
$self->{Sql} = $sql;
} # end if has Sql
return $self->{Sql};