Doh! Fixed in trunk. Thanks for reporting this was a serious issue.
On Sunday, 20 January 2013 12:27:41 UTC-6, Ignacio Ocampo wrote:
>
> I'm working with a custom Query, I need use SUM and COUNT together, when I
> use:
>
> select(db.field.count(), db.field.sum()) works OK
>
> But when I use:
>
> select('COUNT(*)', 'SUM(DATEDIFF(table.field,NOW()))')
>
> I print the output with _select and I see that when I use more that 1
> custom expression, I get the last expression repeated, such as:
>
> SELECT ... FROM table WHERE ... SUM(DATEDIFF(table.field,NOW())),
> SUM(DATEDIFF(table.field,NOW())) ...
>
> If I change the order:
>
> select('SUM(DATEDIFF(table.field,NOW()))', 'COUNT(*)')
>
> I get: SELECT ... FROM table WHERE ... COUNT(*), COUNT(*) ...
>
> Any idea?
>
--