@@ -426,33 +426,26 @@ public static function parse(Parser $parser, TokensList $list, array $options =
426
426
} elseif (($ token ->value === ', ' ) && ($ brackets === 0 )) {
427
427
break ;
428
428
}
429
- } elseif (! self ::checkIfTokenQuotedSymbol ($ token )) {
430
- // If the current token is "SET" or "ENUM", we want to avoid the token between their parenthesis in
431
- // the unknown tokens.
432
- if (in_array ($ token ->value , ['SET ' , 'ENUM ' ], true )) {
429
+ } elseif (! self ::checkIfTokenQuotedSymbol ($ token ) && $ token ->type !== Token::TYPE_STRING ) {
430
+ if (isset (Parser::$ STATEMENT_PARSERS [$ arrayKey ]) && Parser::$ STATEMENT_PARSERS [$ arrayKey ] !== '' ) {
433
431
$ list ->idx ++; // Ignore the current token
434
432
$ nextToken = $ list ->getNext ();
435
433
436
- if ($ nextToken !== null && $ nextToken ->value === '( ' ) {
434
+ if ($ token ->value === 'SET ' && $ nextToken !== null && $ nextToken ->value === '( ' ) {
435
+ // To avoid adding the tokens between the SET() parentheses to the unknown tokens
437
436
$ list ->getNextOfTypeAndValue (Token::TYPE_OPERATOR , ') ' );
438
- } elseif ($ nextToken !== null && $ nextToken ->value === 'DEFAULT ' ) {
437
+ } elseif ($ token -> value === ' SET ' && $ nextToken !== null && $ nextToken ->value === 'DEFAULT ' ) {
439
438
// to avoid adding the `DEFAULT` token to the unknown tokens.
440
439
++$ list ->idx ;
441
440
} else {
441
+ // We have reached the end of ALTER operation and suddenly found
442
+ // a start to new statement, but have not found a delimiter between them
442
443
$ parser ->error (
443
444
'A new statement was found, but no delimiter between it and the previous one. ' ,
444
445
$ token
445
446
);
446
447
break ;
447
448
}
448
- } elseif (! empty (Parser::$ STATEMENT_PARSERS [$ token ->value ])) {
449
- // We have reached the end of ALTER operation and suddenly found
450
- // a start to new statement, but have not found a delimiter between them
451
- $ parser ->error (
452
- 'A new statement was found, but no delimiter between it and the previous one. ' ,
453
- $ token
454
- );
455
- break ;
456
449
} elseif (
457
450
(array_key_exists ($ arrayKey , self ::$ DB_OPTIONS )
458
451
|| array_key_exists ($ arrayKey , self ::$ TABLE_OPTIONS ))
0 commit comments