#35744: Combine query support doesn't repoint nested external references
-------------------------------------+-------------------------------------
Reporter: Simon Charette | Owner: (none)
Type: Bug | Status: assigned
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* summary:
Composite query support doesn't report nested correlated queries
external references
=> Combine query support doesn't repoint nested external references
Old description:
> As I came to discover [
https://forum.djangoproject.com/t/filtering-model-
> instances-m2m-field-to-exactly-match-another-m2m-field-or-list/34533/6
> trying to help someone on the forum] the support for correlated
> subqueries (aka `OuterRef`) in composite queries (`union`,
> `intersection`, `difference`) added in #29338 fails to re-point external
> references on relabeling (an operation performed on subquery pushdown to
> prevent table name collisions) causing nested outer query references to
> be orphaned.
New description:
As I came to discover [
https://forum.djangoproject.com/t/filtering-model-
instances-m2m-field-to-exactly-match-another-m2m-field-or-list/34533/6
trying to help someone on the forum] the support for correlated subqueries
(aka `OuterRef`) in combined queries (`union`, `intersection`,
`difference`) added in #29338 fails to re-point external references on
relabeling (an operation performed on subquery pushdown to prevent table
name collisions) causing nested outer query references to be orphaned.
--
--
Ticket URL: <
https://code.djangoproject.com/ticket/35744#comment:2>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.