Skip to content

Commit 7e773e2

Browse files
predictor2718williamdes
authored andcommitted
Fix ALTER index parsing: DESC should not begin a new statement (#592)
Signed-off-by: Nicolai Ehrhardt <245527909+predictor2718@users.noreply.github.com>
1 parent 0df2427 commit 7e773e2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Components/AlterOperation.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,11 @@ public static function parse(Parser $parser, TokensList $list, array $options =
453453
$token->type !== Token::TYPE_STRING &&
454454
$token->value !== 'CHECK'
455455
) {
456-
if (isset(Parser::$STATEMENT_PARSERS[$arrayKey]) && Parser::$STATEMENT_PARSERS[$arrayKey] !== '') {
456+
if (
457+
isset(Parser::$STATEMENT_PARSERS[$arrayKey])
458+
&& Parser::$STATEMENT_PARSERS[$arrayKey] !== ''
459+
&& ! in_array($arrayKey, ['ASC', 'DESC'], true)
460+
) {
457461
$list->idx++; // Ignore the current token
458462
$nextToken = $list->getNext();
459463

0 commit comments

Comments
 (0)