Skip to content

Commit 92bb872

Browse files
committed
Improve the if-else checks
Signed-off-by: iifawzi <[email protected]>
1 parent 30e8281 commit 92bb872

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Parser.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,12 @@ public function parse()
476476
$second = $list->getNextOfType(Token::TYPE_KEYWORD);
477477

478478
// ANALYZE keyword can be an indication of two cases:
479-
// 1- ANALAYZE TABLE statements, in both mariaDB and MySQL
480-
// 2- Explain statement, in case of mariaDB https://mariadb.com/kb/en/explain-analyze/
481-
// We need to point each case to the correct parser
479+
// 1 - ANALYZE TABLE statements, in both MariaDB and MySQL
480+
// 2 - Explain statement, in case of MariaDB https://mariadb.com/kb/en/explain-analyze/
481+
// We need to point case 2 to use the EXPLAIN Parser.
482+
$statementName = 'EXPLAIN';
482483
if ($first->keyword === 'TABLE' || $second->keyword === 'TABLE') {
483484
$statementName = 'ANALYZE';
484-
} else {
485-
$statementName = 'EXPLAIN';
486485
}
487486

488487
$list->idx = $lastIdx;

0 commit comments

Comments
 (0)