#36248: Bulk deletion of model referred to by a SET_NULL key can exceed
parameter
limit
-------------------------------------+-------------------------------------
Reporter: bobince | Owner: bobince
Type: Bug | Status: assigned
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | 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):
* owner: (none) => bobince
* stage: Unreviewed => Accepted
* status: new => assigned
* type: Uncategorized => Bug
Comment:
The analysis and the patch here are on point (thanks bobince!) so I'll
accept and mark with ''has_patch''.
The only thing I'd change is the test so `bulk_batch_size` is mocked to
return a small number (e.g. 10) and not only test the number of executed
queries but count the number of parameters for each queries (you can use
`self.assertNumQueries` as a context manager for that).
That would avoid having to create 200s objects unnecessarily but more
importantly test the chunking logic in a backend agnostic way.
--
Ticket URL: <https://code.djangoproject.com/ticket/36248#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019588f38310-87204e4a-cb76-4041-9c8c-1cb8c7dfb24d-000000%40eu-central-1.amazonses.com.