Skip to content

Commit cdb74aa

Browse files
committed
Merge branch 'iifawzi/fixing-export-views-union' into QA
To remove a non covered test case Signed-off-by: William Desportes <[email protected]>
2 parents 0885301 + 24eed88 commit cdb74aa

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

src/Statements/CreateStatement.php

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -695,28 +695,23 @@ public function parse(Parser $parser, TokensList $list)
695695
$list->getNext();
696696
}
697697

698-
// Parsing the SELECT expression with and without the `AS` keyword
699-
if ($token->type === Token::TYPE_KEYWORD
700-
&& $token->keyword === 'SELECT'
698+
// Parsing the SELECT expression if the view started with it.
699+
if (
700+
$token->type === Token::TYPE_KEYWORD
701+
&& $token->keyword === 'AS'
702+
&& $list->tokens[$nextidx]->type === Token::TYPE_KEYWORD
703+
&& $list->tokens[$nextidx]->value === 'SELECT'
701704
) {
705+
$list->idx = $nextidx;
702706
$this->select = new SelectStatement($parser, $list);
703-
} else {
704-
if (
705-
$token->type === Token::TYPE_KEYWORD
706-
&& $token->keyword === 'AS'
707-
&& $list->tokens[$nextidx]->type === Token::TYPE_KEYWORD
708-
&& $list->tokens[$nextidx]->value === 'SELECT'
709-
) {
710-
$list->idx = $nextidx;
711-
$this->select = new SelectStatement($parser, $list);
712-
}
713-
for (; $list->idx < $list->count; ++$list->idx) {
714-
$token = $list->tokens[$list->idx];
715-
if ($token->type === Token::TYPE_DELIMITER) {
716-
break;
717-
}
718-
$this->body[] = $token;
707+
}
708+
// Parsing all other tokens
709+
for (; $list->idx < $list->count; ++$list->idx) {
710+
$token = $list->tokens[$list->idx];
711+
if ($token->type === Token::TYPE_DELIMITER) {
712+
break;
719713
}
714+
$this->body[] = $token;
720715
}
721716
} elseif ($this->options->has('TRIGGER')) {
722717
// Parsing the time and the event.

0 commit comments

Comments
 (0)