#459786 by DamZ: Remove all_fields from extended queries to prevent breaking under PostgreSQL and certain MySQL versions.
							parent
							
								
									6445ba5986
								
							
						
					
					
						commit
						a81eaade50
					
				| 
						 | 
				
			
			@ -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();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue