#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
-------------------------------------+-------------------------------------
Comment (by bobince):
> The only thing I'd change is the test so bulk_batch_size is mocked to
return a small number
will do!
> count the number of parameters for each queries
Yeah that's what I wanted to do, but was frustrated:
connection.queries_log/assertNumQueries doesn't keep hold of the number of
parameters, and you can't infer them from `%s` being in the SQL string
because DebugCursorWrapper uses last_executed_query to replace them with
parameter values.
I guess I could scrape the SQL string for number of integers but this
feels pretty fragile. Or I could add a "params_count" entry to the dicts
in queries_log, but that's more intrusive than I'd like just for the
benefit of one test.
--
Ticket URL: <https://code.djangoproject.com/ticket/36248#comment:3>
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/010701958a4ec32f-38e8ba47-e908-49b8-ae9b-30c6ed7020c2-000000%40eu-central-1.amazonses.com.