Skip to content

Commit 54b5586

Browse files
committed
Fix ALTER index parsing: DESC should not begin a new statement (#592)
Signed-off-by: Nicolai Ehrhardt <[email protected]>
1 parent 7539780 commit 54b5586

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Parsers/AlterOperations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
370370
break;
371371
}
372372
} elseif (! self::checkIfTokenQuotedSymbol($token) && $token->type !== TokenType::String) {
373-
if (isset(Parser::STATEMENT_PARSERS[$arrayKey]) && Parser::STATEMENT_PARSERS[$arrayKey] !== '') {
373+
if (isset(Parser::STATEMENT_PARSERS[$arrayKey]) && Parser::STATEMENT_PARSERS[$arrayKey] !== '' && ! in_array($arrayKey, ['ASC', 'DESC'], true)) {
374374
$list->idx++; // Ignore the current token
375375
$nextToken = $list->getNext();
376376

0 commit comments

Comments
 (0)