-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DDC-2310] Fix evaluation of NOLOCK table hint on SQL Server #508
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-783 We use Jira to track the state of pull requests and the versions they got |
@@ -1347,14 +1347,14 @@ public function rollbackSavePoint($savepoint) | |||
*/ | |||
public function appendLockHint($fromClause, $lockMode) | |||
{ | |||
switch ($lockMode) { | |||
case LockMode::NONE: | |||
switch (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to if (...) { return ...; }
blocks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I will do.
@deeky666 I'd say the ORM is wrong here, since the docblock for |
@Ocramius I don't know if action has to be taken in ORM. At least the current implementation here is wrong because |
@deeky666 changing the docblock to allow Introducing the exception can be simply |
[DDC-2310] Fix evaluation of NOLOCK table hint on SQL Server
This PR is complementary to doctrine/orm#910.
ORM passes
null
toAbstractPlatform::appendLockHint()
as$lockMode
which should not evaluated toLockMode::NONE
unless0
is explictly given. Otherwise ORM appendsWITH (NOLOCK)
to all queries even though, no query lock hint is set.