From a8c25c6146496dc77b3ca56b3d94450c054ec7b8 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 11 Dec 2019 17:57:23 +0300 Subject: [PATCH] - added support for SELECT FOR UPDATE - added stable 7.4 version --- src/Driver/SQLServer/SQLServerCompiler.php | 2 +- tests/Database/SQLServer/SelectQueryTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Driver/SQLServer/SQLServerCompiler.php b/src/Driver/SQLServer/SQLServerCompiler.php index 81db1bec..17a981fa 100644 --- a/src/Driver/SQLServer/SQLServerCompiler.php +++ b/src/Driver/SQLServer/SQLServerCompiler.php @@ -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), ' '), diff --git a/tests/Database/SQLServer/SelectQueryTest.php b/tests/Database/SQLServer/SelectQueryTest.php index b9cb0a79..31c05bf6 100644 --- a/tests/Database/SQLServer/SelectQueryTest.php +++ b/tests/Database/SQLServer/SelectQueryTest.php @@ -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 ); }