Skip to content
Snippets Groups Projects
Commit a81eaade authored by Angie Byron's avatar Angie Byron
Browse files

#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
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -568,6 +568,12 @@ public function countQuery() { ...@@ -568,6 +568,12 @@ public function countQuery() {
$expressions =& $count->getExpressions(); $expressions =& $count->getExpressions();
$expressions = array(); $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 // Ordering a count query is a waste of cycles, and breaks on some
// databases anyway. // databases anyway.
$orders = &$count->getOrderBy(); $orders = &$count->getOrderBy();
...@@ -1030,6 +1036,13 @@ public function countQuery() { ...@@ -1030,6 +1036,13 @@ public function countQuery() {
$expressions =& $count->getExpressions(); $expressions =& $count->getExpressions();
$expressions = array(); $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 // Ordering a count query is a waste of cycles, and breaks on some
// databases anyway. // databases anyway.
$orders = &$count->getOrderBy(); $orders = &$count->getOrderBy();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment