First of all, the phpdoc indicates a return value, but the function does not return any value.

Second,

     // If grouping, all items in the order by must also be in the
    // group by clause.
    if ($this->groupby) {
      $this->add_groupby($as);
    }
 

This code will add *any* field that's in ORDER BY clause to the GROUP BY clause, however if the field is a formula it shouldn't be added to the GROUP BY clause because then MySQL at least will return an error.

Comments

merlinofchaos’s picture

Status: Active » Fixed

Fixed. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.