8000 Fixed parser rejecting valid DQL by carnage · Pull Request #7053 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixed parser rejecting valid DQL #7053

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Query/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function match($token)
}

// If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+)
if ($token === Lexer::T_IDENTIFIER && $lookaheadType < Lexer::T_IDENTIFIER) {
if ($token === Lexer::T_IDENTIFIER && $lookaheadType >= Lexer::T_IDENTIFIER) {
$this->syntaxError($this->lexer->getLiteral($token));
}
}
Expand Down
8 changes: 8 additions & 0 deletions tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed)
}
}

public function testSupportsDeleteWithoutWhereAndAlias()
{
$this->assertSqlGeneration(
'DELETE FROM Doctrine\Tests\Models\CMS\CmsUser',
'DELETE FROM cms_users'
);
}

public function testSupportsDeleteWithoutWhereAndFrom()
{
$this->assertSqlGeneration(
Expand Down
0