Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
- added support for SELECT FOR UPDATE
Browse files Browse the repository at this point in the history
- added stable 7.4 version
  • Loading branch information
wolfy-j committed Dec 11, 2019
1 parent 8a1e277 commit a8c25c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Driver/SQLServer/SQLServerCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private function baseSelect(
$this->optional(' ', $this->compileDistinct($bindings, $distinct)),
$this->compileColumns($bindings, $columns),
$tableNames,
$this->optional(' ', $forUpdate ? 'WITH (UPDLOCK, ROWLOCK)' : '', ' '),
$this->optional(' ', $forUpdate ? 'WITH (UPDLOCK,ROWLOCK)' : '', ' '),
$this->optional(' ', $joinsStatement, ' '),
$this->optional("\nWHERE", $this->compileWhere($bindings, $whereTokens)),
$this->optional("\nGROUP BY", $this->compileGroupBy($bindings, $grouping), ' '),
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/SQLServer/SelectQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testSelectForUpdate(): void
->forUpdate();

$this->assertSameQuery(
'SELECT * FROM {users} WITH(UPDLOCK) WHERE {name} = ?',
'SELECT * FROM {users} WITH(UPDLOCK,ROWLOCK) WHERE {name} = ?',
$select
);
}
Expand Down

0 comments on commit a8c25c6

Please sign in to comment.