Fix FOR UPDATE SQL on SQL Anywhere #561

Merged
merged 1 commit into from May 16, 2014

Projects

None yet

3 participants

@deeky666
Doctrine member

It looks like there was a misunderstanding on SQL Anywhere with the FOR UPDATE SQL as this is actually a statement used in prepared statements and does not work the ANSI way in ORM. So I removed it in favour of the table lock hint implementation which works out quite well and makes the getForUpdateSQL() rather useless anyways. SQL Server does it like this, too btw and both dialects are pretty similar because SQL Anywhere once derived from it.

@doctrinebot

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-856

We use Jira to track the state of pull requests and the versions they got
included in.

@deeky666
Doctrine member

See the documentation for reference on that.

@Ocramius Ocramius and 1 other commented on an outdated diff Mar 31, 2014
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
@@ -697,7 +697,7 @@ public function getForeignKeyReferentialActionSQL($action)
*/
public function getForUpdateSQL()
{
- return 'FOR UPDATE BY LOCK';
+ return ' ';
@Ocramius
Ocramius Mar 31, 2014

@deeky666 any reason for it to be ' ' and not ''? I don't really get it

@deeky666
deeky666 Mar 31, 2014

@Ocramius yeah you are right. Adopted it from SQLServerPlatform. Seems ORM is always prepending a space anyways. I'll change that, thanks.

@Ocramius Ocramius self-assigned this May 16, 2014
@Ocramius Ocramius merged commit 6a120fb into doctrine:master May 16, 2014

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment