summaryrefslogtreecommitdiffstats
path: root/src/Components/IntoKeyword.php
diff options
context:
space:
mode:
authorMichal Čihař <michal@cihar.com>2017-02-06 11:57:13 +0100
committerMichal Čihař <michal@cihar.com>2017-02-06 12:00:36 +0100
commit1a1168169c3d3acdf7ee3c5f1a839bcb66829297 (patch)
tree9155edf897f19bfc003991e300630f3a67f2ffd5 /src/Components/IntoKeyword.php
parent5fdfa5b0767c8b62e5dd16f1b99465c2d59c9d2f (diff)
downloadsql-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.php4
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;
}