diff options
Diffstat (limited to 'includes/database')
-rw-r--r-- | includes/database/select.inc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/includes/database/select.inc b/includes/database/select.inc index ef0455fca..74a66b954 100644 --- a/includes/database/select.inc +++ b/includes/database/select.inc @@ -461,7 +461,7 @@ class SelectQueryExtender implements SelectQueryInterface { } public function having($snippet, $args = array()) { - $this->query->where($snippet, $args); + $this->query->having($snippet, $args); return $this; } @@ -570,7 +570,8 @@ class SelectQueryExtender implements SelectQueryInterface { // Also remove 'all_fields' statements, which are expanded into tablename.* // when the query is executed. - foreach ($count->tables as $alias => &$table) { + $tables = &$count->getTables(); + foreach ($tables as $alias => &$table) { unset($table['all_fields']); } @@ -866,7 +867,7 @@ class SelectQuery extends Query implements SelectQueryInterface { $args += $table['arguments']; } // If this table is a subquery, grab its arguments recursively. - if ($table['table'] instanceof SelectQuery) { + if ($table['table'] instanceof SelectQueryInterface) { $args += $table['table']->getArguments(); } } @@ -985,7 +986,7 @@ class SelectQuery extends Query implements SelectQueryInterface { public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array()) { if (empty($alias)) { - if ($table instanceof SelectQuery) { + if ($table instanceof SelectQueryInterface) { $alias = 'subquery'; } else { @@ -1089,7 +1090,7 @@ class SelectQuery extends Query implements SelectQueryInterface { } // If the table is a subquery, compile it and integrate it into this query. - if ($table['table'] instanceof SelectQuery) { + if ($table['table'] instanceof SelectQueryInterface) { $table_string = '(' . (string)$table['table'] .')'; } else { |