Skip to content

Commit

Permalink
update skipLocked() method for OCI8
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Sep 20, 2024
1 parent 1952bcb commit ca8e0b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Models/QueueJobModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ private function skipLocked(string $sql): string
}

if ($this->db->DBDriver === 'OCI8') {
$sql = "SELECT * FROM ({$sql}) subquery";
$sql = preg_replace('/ OFFSET .*/', '', $sql);
$sql = "SELECT * FROM ({$sql}) WHERE ROWNUM = 1";
}

return $sql .= ' FOR UPDATE SKIP LOCKED';
Expand Down

0 comments on commit ca8e0b9

Please sign in to comment.