Re: [Django] #35147: Document that non-wrapped arithmetic with integer fields might require explicit output_field

51 views
Skip to first unread message

Django

unread,
Jan 29, 2024, 9:26:58 PM1/29/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: annotate, bitand, | Triage Stage: Accepted
filter, integerfield, overflow |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham):

Replying to [comment:6 Petar Netev]:
> Hi Natalia and Simon,
>
> I would like to prepare the patch, but I would need some clarifications
on it.
>
> - Do we reference the release notes for version 5.0, specifically
https://docs.djangoproject.com/en/5.0/releases/5.0/#models ?
> - Do we reference the documentation of the F()
https://docs.djangoproject.com/en/5.0/releases/5.0/#models ?
>
> Simon, can you share the commit related to "I'm fairly certain this
relates to a commit meant to address a SQLite crash and a DDOS vector on
Postgres only present in 5.0" in order to mention it in the docs
improvements?
>
> Thank you both!
--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 29, 2024, 9:34:55 PM1/29/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: annotate, bitand, | Triage Stage: Accepted
filter, integerfield, overflow |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

Replying to [comment:6 Petar Netev]:
> Hi Natalia and Simon,
>
> I would like to prepare the patch, but I would need some clarifications
on it.
>

> - Do we refference the release notes for version 5.0, specifically
https://docs.djangoproject.com/en/5.0/releases/5.0/#models ?
> - Do we refference the documentation of the F()


https://docs.djangoproject.com/en/5.0/releases/5.0/#models ?
>
> Simon, can you share the commit related to "I'm fairly certain this
relates to a commit meant to address a SQLite crash and a DDOS vector on
Postgres only present in 5.0" in order to mention it in the docs
improvements?

dde2537fbb04ad78a673092a931b449245a2d6ae is the commit I was referring to,
we don't refer to commits or ticket numbers in docs though.

I think the existing documentation is clear enough that
`ExpressionWrapper` might be necessary in these cases, the only admonition
I would add, assuming we believe it might be valuable is a note in
[https://docs.djangoproject.com/en/5.0/releases/5.0/#miscellaneous the
miscellaneous section] of the 5.0 release notes mentioning that explicit
`ExpressionWrapper` wrapping might be necessary for integer field
arithmetic that can overflow while it wasn't the case in previous release
by referencing at the documentation mentioned in comment:2.
--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:9>

Django

unread,
Jan 30, 2024, 1:49:11 AM1/30/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: Petar
Type: | Netev
Cleanup/optimization | Status: assigned

Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: annotate, bitand, | Triage Stage: Accepted
filter, integerfield, overflow |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Petar Netev):

* owner: nobody => Petar Netev
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:10>

Django

unread,
Jan 31, 2024, 2:53:35 PM1/31/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: Petar
Type: | Netev
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: annotate, bitand, | Triage Stage: Accepted
filter, integerfield, overflow |
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:11>

Django

unread,
Jan 31, 2024, 11:57:54 PM1/31/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: Petar
Type: | Netev
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: annotate, bitand, | Triage Stage: Accepted
filter, integerfield, overflow |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:12>

Django

unread,
Feb 1, 2024, 12:39:39 PM2/1/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: Petar
Type: | Netev
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.0
Severity: Normal | Resolution:
Keywords: annotate, bitand, | Triage Stage: Ready for
filter, integerfield, overflow | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:13>

Django

unread,
Feb 1, 2024, 2:36:43 PM2/1/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: Petar
Type: | Netev
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: fixed

Keywords: annotate, bitand, | Triage Stage: Ready for
filter, integerfield, overflow | 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:"0630ca5725ba5b17c61cd1f6a05dce2660c4724e" 0630ca5]:
{{{#!CommitTicketReference repository=""
revision="0630ca5725ba5b17c61cd1f6a05dce2660c4724e"
Fixed #35147 -- Added backward incompatibility note about filtering
against overflowing integers.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:14>

Django

unread,
Feb 1, 2024, 2:37:11 PM2/1/24
to django-...@googlegroups.com
#35147: Document that non-wrapped arithmetic with integer fields might require
explicit output_field
-------------------------------------+-------------------------------------
Reporter: Petar Netev | Owner: Petar
Type: | Netev
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: annotate, bitand, | Triage Stage: Ready for
filter, integerfield, overflow | 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:"741f080ab595fa34ad0d682a096026abade0dcab" 741f080]:
{{{#!CommitTicketReference repository=""
revision="741f080ab595fa34ad0d682a096026abade0dcab"
[5.0.x] Fixed #35147 -- Added backward incompatibility note about
filtering against overflowing integers.

Backport of 0630ca5725ba5b17c61cd1f6a05dce2660c4724e from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35147#comment:15>

Reply all
Reply to author
Forward
0 new messages