summaryrefslogtreecommitdiffstats
path: root/src/Utils/Query.php
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-07-25 14:31:59 +0300
committerDan Ungureanu <udan1107@gmail.com>2015-07-25 14:31:59 +0300
commitf1b0644ea90d427acd58aefc9d27137349fc13f3 (patch)
tree89c9336c157aea3d4701b2c984da7f257ef5c7ca /src/Utils/Query.php
parent6e335616597277d0687bd036fc9acc05386369a0 (diff)
downloadsql-parser-f1b0644ea90d427acd58aefc9d27137349fc13f3.zip
sql-parser-f1b0644ea90d427acd58aefc9d27137349fc13f3.tar.gz
sql-parser-f1b0644ea90d427acd58aefc9d27137349fc13f3.tar.bz2
Fixed some Scrutinizer issues.
Diffstat (limited to 'src/Utils/Query.php')
-rw-r--r--src/Utils/Query.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Utils/Query.php b/src/Utils/Query.php
index 1f887ab..c11e858 100644
--- a/src/Utils/Query.php
+++ b/src/Utils/Query.php
@@ -536,7 +536,7 @@ class Query
// This is a cheap fix for `SELECT` statements that contain `UNION`.
// Replacing the `ORDER BY` or `LIMIT` clauses should replace the last
// clause.
- if (!empty($statement->union)) {
+ if (($statement instanceof SelectStatement) && (!empty($statement->union))) {
$clauses['ORDER BY'] = count($clauses) + 1;
$clauses['LIMIT'] = count($clauses) + 2;
}