Opened 7 years ago
Closed 7 years ago
#29668 closed Bug (invalid)
missing FROM-clause entry in subquery with extra
| Reported by: | pranavneeraj | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 2.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Mariusz Felisiak | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Turn.active_objects.all().select_related('request__address').extra(select={'start_time_tz': '(start_time AT TIME ZONE COALESCE("api_address".timezone))'}).distinct() Works but Turn.active_objects.all().select_related('request__address').extra(select={'start_time_tz': '(start_time AT TIME ZONE COALESCE("api_address".timezone))'}).distinct().count() doesn't.
Because count executes subquery.
Change History (5)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
| Component: | Uncategorized → Database layer (models, ORM) |
|---|
comment:3 by , 7 years ago
| Severity: | Normal → Release blocker |
|---|
comment:4 by , 7 years ago
| Cc: | added |
|---|---|
| Severity: | Release blocker → Normal |
I wouldn't mark this as a release blocker if it is there since Django 1.9. Have you confirmed that issue appears in the supported versions e.g. 2.0 or 2.1?
comment:5 by , 7 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
Even if it's still an issue, we're no longer fixing bugs with QuerySet.extra() per discussion on django-developers.
Version is 1.9.