Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#10290 closed (fixed)

grouping with extra_selects produces invalid sql

Reported by: Erin Kelly Owned by:
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

From [9838] on, I'm getting aggregation_regress test failures in Oracle, apparently because annotations with extra selects are adding the extra select aliases into the group by list. This produces invalid SQL (at least in Oracle), since you can't use column aliases defined at the same level within a group by clause.

The attached patch uses the extra select expression itself in the group by, rather than the alias. This passes the tests across all four included backends, and seems to work in general as long as the expression is not a scalar subquery.

Attachments (1)

10290.diff (1.1 KB ) - added by Erin Kelly 16 years ago.

Download all attachments as: .zip

Change History (3)

by Erin Kelly, 16 years ago

Attachment: 10290.diff added

comment:1 by Erin Kelly, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in [9905].

comment:2 by Anssi Kääriäinen, 12 years ago

Component: ORM aggregationDatabase layer (models, ORM)
Note: See TracTickets for help on using tickets.
Back to Top