diff options
author | Michal Čihař <michal@cihar.com> | 2017-02-06 11:57:13 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2017-02-06 12:00:36 +0100 |
commit | 1a1168169c3d3acdf7ee3c5f1a839bcb66829297 (patch) | |
tree | 9155edf897f19bfc003991e300630f3a67f2ffd5 /src/Components/IntoKeyword.php | |
parent | 5fdfa5b0767c8b62e5dd16f1b99465c2d59c9d2f (diff) | |
download | sql-parser-1a1168169c3d3acdf7ee3c5f1a839bcb66829297.zip sql-parser-1a1168169c3d3acdf7ee3c5f1a839bcb66829297.tar.gz sql-parser-1a1168169c3d3acdf7ee3c5f1a839bcb66829297.tar.bz2 |
Use keyword attribute for comparing keyword name
We do not uppercase non reserved keywords, so this way we make the
comparison properly handle that.
Signed-off-by: Michal Čihař <michal@cihar.com>
Diffstat (limited to 'src/Components/IntoKeyword.php')
-rw-r--r-- | src/Components/IntoKeyword.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Components/IntoKeyword.php b/src/Components/IntoKeyword.php index a8e80b4..a5c2d24 100644 --- a/src/Components/IntoKeyword.php +++ b/src/Components/IntoKeyword.php @@ -141,7 +141,7 @@ class IntoKeyword extends Component } if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { - if (($state === 0) && ($token->value === 'OUTFILE')) { + if (($state === 0) && ($token->keyword === 'OUTFILE')) { $ret->type = 'OUTFILE'; $state = 2; continue; @@ -185,7 +185,7 @@ class IntoKeyword extends Component $ret->parseFileOptions($parser, $list, $token->value); $state = 4; } elseif ($state == 4) { - if ($token->type === Token::TYPE_KEYWORD && $token->value !== 'LINES') { + if ($token->type === Token::TYPE_KEYWORD && $token->keyword !== 'LINES') { break; } |