diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-11 20:13:43 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-05-11 20:13:43 +0000 |
commit | a81eaade5096f284cc4d011360e9bd79c655690a (patch) | |
tree | b7fce297a67faf0457715e796c24fdb075c04662 | |
parent | 6445ba5986760d38b1f91a3f8fb1170a480c82c6 (diff) | |
download | brdo-a81eaade5096f284cc4d011360e9bd79c655690a.tar.gz brdo-a81eaade5096f284cc4d011360e9bd79c655690a.tar.bz2 |
#459786 by DamZ: Remove all_fields from extended queries to prevent breaking under PostgreSQL and certain MySQL versions.
-rw-r--r-- | includes/database/select.inc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/includes/database/select.inc b/includes/database/select.inc index 633965dcc..ef0455fca 100644 --- a/includes/database/select.inc +++ b/includes/database/select.inc @@ -568,6 +568,12 @@ class SelectQueryExtender implements SelectQueryInterface { $expressions =& $count->getExpressions(); $expressions = array(); + // Also remove 'all_fields' statements, which are expanded into tablename.* + // when the query is executed. + foreach ($count->tables as $alias => &$table) { + unset($table['all_fields']); + } + // Ordering a count query is a waste of cycles, and breaks on some // databases anyway. $orders = &$count->getOrderBy(); @@ -1030,6 +1036,13 @@ class SelectQuery extends Query implements SelectQueryInterface { $expressions =& $count->getExpressions(); $expressions = array(); + + // Also remove 'all_fields' statements, which are expanded into tablename.* + // when the query is executed. + foreach ($count->tables as $alias => &$table) { + unset($table['all_fields']); + } + // Ordering a count query is a waste of cycles, and breaks on some // databases anyway. $orders = &$count->getOrderBy(); |