From 4171015df1d4356f42ce19b34eb034f6aad7d480 Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Tue, 27 Sep 2011 10:18:23 +1300 Subject: [PATCH] MINOR SQLQuery without a FROM table should return empty query --- model/SQLQuery.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/model/SQLQuery.php b/model/SQLQuery.php index b25832811..e53b826c9 100644 --- a/model/SQLQuery.php +++ b/model/SQLQuery.php @@ -458,6 +458,10 @@ class SQLQuery { // TODO: Don't require this internal-state manipulate-and-preserve - let sqlQueryToString() handle the new syntax $origFrom = $this->from; + if(!$this->from) { + return ''; + } + // Build from clauses foreach($this->from as $alias => $join) { // $join can be something like this array structure