Commit a81eaade authored by webchick's avatar webchick

#459786 by DamZ: Remove all_fields from extended queries to prevent breaking...

#459786 by DamZ: Remove all_fields from extended queries to prevent breaking under PostgreSQL and certain MySQL versions.
parent 6445ba59
......@@ -568,6 +568,12 @@ public function countQuery() {
$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 @@ public function countQuery() {
$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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment