Permalink
Browse files

MINOR SQLQuery without a FROM table should return empty query

  • Loading branch information...
1 parent 37d197c commit 4171015df1d4356f42ce19b34eb034f6aad7d480 Stig Lindqvist committed Sep 26, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 model/SQLQuery.php
View
@@ -458,6 +458,10 @@ function sql() {
// 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

0 comments on commit 4171015

Please sign in to comment.