Re: [Django] #34612: QuerySet.only() doesn't work with select_related() on a reverse OneToOneField relation.

Visto 2 veces
Saltar al primer mensaje no leído

Django

no leída,
31 may 2023, 17:39:5831/5/23
a django-...@googlegroups.com
#34612: QuerySet.only() doesn't work with select_related() on a reverse
OneToOneField relation.
-------------------------------------+-------------------------------------
Reporter: Ian Cubitt | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* owner: nobody => Simon Charette
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34612#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

no leída,
31 may 2023, 18:30:0631/5/23
a django-...@googlegroups.com
#34612: QuerySet.only() doesn't work with select_related() on a reverse
OneToOneField relation.
-------------------------------------+-------------------------------------
Reporter: Ian Cubitt | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/34612#comment:3>

Django

no leída,
1 jun 2023, 14:54:371/6/23
a django-...@googlegroups.com
#34612: QuerySet.only() doesn't work with select_related() on a reverse
OneToOneField relation.
-------------------------------------+-------------------------------------
Reporter: Ian Cubitt | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


Comment:

[https://github.com/django/django/pull/16910 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34612#comment:4>

Django

no leída,
1 jun 2023, 15:25:241/6/23
a django-...@googlegroups.com
#34612: QuerySet.only() doesn't work with select_related() on a reverse
OneToOneField relation.
-------------------------------------+-------------------------------------
Reporter: Ian Cubitt | Owner: Simon
| Charette
Type: Bug | Status: closed

Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"2cf76f2d5d1aa16acfadaf53db3d30128a34b088" 2cf76f2d]:
{{{
#!CommitTicketReference repository=""
revision="2cf76f2d5d1aa16acfadaf53db3d30128a34b088"
Fixed #34612 -- Fixed QuerySet.only() crash on reverse relationships.

Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.

Thanks Ian Cubitt for the report.

This also corrected test_inheritance_deferred2() test which was
previously properly defined and marked as an expected failure but was
then wrongly adjusted to mask the lack of support for per-alias
deferral that was fixed by #21204.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34612#comment:5>

Django

no leída,
1 jun 2023, 15:28:071/6/23
a django-...@googlegroups.com
#34612: QuerySet.only() doesn't work with select_related() on a reverse
OneToOneField relation.
-------------------------------------+-------------------------------------
Reporter: Ian Cubitt | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"738386470d899c61cb1980233c1e7872ba78e679" 7383864]:
{{{
#!CommitTicketReference repository=""
revision="738386470d899c61cb1980233c1e7872ba78e679"
[4.2.x] Fixed #34612 -- Fixed QuerySet.only() crash on reverse
relationships.

Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.

Thanks Ian Cubitt for the report.

This also corrected test_inheritance_deferred2() test which was
previously properly defined and marked as an expected failure but was
then wrongly adjusted to mask the lack of support for per-alias
deferral that was fixed by #21204.

Backport of 2cf76f2d5d1aa16acfadaf53db3d30128a34b088 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34612#comment:6>

Django

no leída,
23 abr 2024, 12:17:2823 abr
a django-...@googlegroups.com
#34612: QuerySet.only() doesn't work with select_related() on a reverse
OneToOneField relation.
-------------------------------------+-------------------------------------
Reporter: Ian Cubitt | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"83f5478225588f31e7cbbfed63a4a2b936abc03f" 83f54782]:
{{{#!CommitTicketReference repository=""
revision="83f5478225588f31e7cbbfed63a4a2b936abc03f"
Fixed #35356 -- Deferred self-referential foreign key fields adequately.

While refs #34612 surfaced issues with reverse one-to-one fields
deferrals, it missed that switching to storing remote fields would break
self-referential relationships.

This change switches to storing related objects in the select mask
instead of remote fields to prevent collisions when dealing with
self-referential relationships that might have a different directional
mask.

Despite fixing #21204 introduced a crash under some self-referential
deferral conditions, it was simply not working even before that as it
aggregated the sets of deferred fields by model.

Thanks Joshua van Besouw for the report and Mariusz Felisiak for the
review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34612#comment:7>
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos