summaryrefslogtreecommitdiffstats
path: root/src/Utils/Query.php
diff options
context:
space:
mode:
authorDeven Bansod <devenbansod.bits@gmail.com>2019-03-12 22:38:13 +0530
committerDeven Bansod <devenbansod.bits@gmail.com>2019-03-12 22:54:40 +0530
commit1d8f85c695ad3777e403eefdcf0f59fcba207b78 (patch)
tree657548b58221ac9c0eed78112363db3f74ec8747 /src/Utils/Query.php
parenta404e855c90692efea8e9e77004be56fc0d7c8e2 (diff)
downloadsql-parser-1d8f85c695ad3777e403eefdcf0f59fcba207b78.zip
sql-parser-1d8f85c695ad3777e403eefdcf0f59fcba207b78.tar.gz
sql-parser-1d8f85c695ad3777e403eefdcf0f59fcba207b78.tar.bz2
fix: incorrect lastClauseIdx in Util::getQuery
Diffstat (limited to 'src/Utils/Query.php')
-rw-r--r--src/Utils/Query.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utils/Query.php b/src/Utils/Query.php
index 662404b..7b14ded 100644
--- a/src/Utils/Query.php
+++ b/src/Utils/Query.php
@@ -594,7 +594,7 @@ class Query
$clauseIdx = $clauses[$clauseType];
$firstClauseIdx = $clauseIdx;
- $lastClauseIdx = $clauseIdx + 1;
+ $lastClauseIdx = $clauseIdx;
// Determining the behavior of this function.
if ($type === -1) {
@@ -603,7 +603,7 @@ class Query
} elseif ($type === 1) {
$firstClauseIdx = $clauseIdx + 1;
$lastClauseIdx = 10000; // Something big enough.
- } elseif (is_string($type)) {
+ } elseif (is_string($type) && isset($clauses[$type])) {
if ($clauses[$type] > $clauseIdx) {
$firstClauseIdx = $clauseIdx + 1;
$lastClauseIdx = $clauses[$type] - 1;