Skip to content

DDC-2914: [GH-910] [DDC-2310] Fix SQL generation on table lock hint capable platforms #3673

Closed
doctrinebot opened this Issue Jan 13, 2014 · 5 comments

2 participants

@doctrinebot

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of deeky666:

Url: #910

Message:

SQL Server and SQL Anywhere use table lock hints for locking. ORM generates wrong SQL when used in conjunction with joins, in a table inheritance scenario or in a subquery. It places the table lock hints after the JOIN clauses, which is wrong. The table lock hints have to be placed after each table alias in the FROM clause.

Example (current)

SELECT t0.id FROM users t0 INNER JOIN profiles t1 ON t0.id = t1.user_id WITH (NOLOCK)

Example (expected)

SELECT t0.id FROM users t0 WITH (NOLOCK) INNER JOIN profiles t1 ON t0.id = t1.user_id

The testsuites fail big time at the moment because of that and I suppose ORM is more or less unusable at the moment for those platforms without this patch.

I needed to adjust a lot of tests which compared compiled DQL, to make use of the platforms specific lock hint clauses.
Also I did not add new tests because there are already so many tests, where this fails without this patch that this is not necessary IMO.

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-910] was closed:
#910

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-925] was assigned:
#925

@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-925] was closed:
#925

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.5 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.