Opened 64 minutes ago
Last modified 47 minutes ago
#37407 assigned Bug
UUIDTextMixin.process_rhs() mutates the lookup's rhs in place corrupting repeated compilation
| Reported by: | Clifford Gama | Owned by: | Clifford Gama |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 6.1 |
| Severity: | Normal | Keywords: | mutate |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
django/db/models/lookups.py#L791-L795 reassigns self.rhs directly instead of working on a copy, so recompiling a shared Lookup (e.g. str(queryset.query) called twice, or a cloned queryset) wraps the already-stripped rhs in another Replace() call each time, growing the SQL/params on every pass.
Note:
See TracTickets
for help on using tickets.