diff options
author | Dan Ungureanu <udan1107@gmail.com> | 2015-07-25 13:30:30 +0300 |
---|---|---|
committer | Dan Ungureanu <udan1107@gmail.com> | 2015-07-25 13:30:30 +0300 |
commit | fc390a8d2af884f5f81dd313687046932a833b2e (patch) | |
tree | 77de6062d53f70ec498873fdbd4f972704e8b158 | |
parent | 0a76734db341f2d0ebd4ea0d1463d2731a59ceda (diff) | |
download | sql-parser-fc390a8d2af884f5f81dd313687046932a833b2e.zip sql-parser-fc390a8d2af884f5f81dd313687046932a833b2e.tar.gz sql-parser-fc390a8d2af884f5f81dd313687046932a833b2e.tar.bz2 |
Added support for SELECT * FROM dual;
-rw-r--r-- | src/Components/Expression.php | 5 | ||||
-rw-r--r-- | src/Components/ExpressionArray.php | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Components/Expression.php b/src/Components/Expression.php index b9f257c..d7d0d4a 100644 --- a/src/Components/Expression.php +++ b/src/Components/Expression.php @@ -175,7 +175,10 @@ class Expression extends Component continue; } - if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { + if (($token->type === Token::TYPE_KEYWORD) + && ($token->flags & Token::FLAG_KEYWORD_RESERVED) + && ($token->value !== 'DUAL') + ) { // Keywords may be found only between brackets. if ($brackets === 0) { if ((empty($options['noAlias'])) && ($token->value === 'AS')) { diff --git a/src/Components/ExpressionArray.php b/src/Components/ExpressionArray.php index e006aaf..2e082dc 100644 --- a/src/Components/ExpressionArray.php +++ b/src/Components/ExpressionArray.php @@ -67,7 +67,10 @@ class ExpressionArray extends Component continue; } - if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { + if (($token->type === Token::TYPE_KEYWORD) + && ($token->flags & Token::FLAG_KEYWORD_RESERVED) + && ($token->value !== 'DUAL') + ) { // No keyword is expected. break; } |