#33319: Query.change_aliases raises an AssertionError
-------------------------------------+-------------------------------------
     Reporter:  Ömer Faruk Abacı     |                    Owner:  Vishal
                                     |  Pandey
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               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):

 * cc: Simon Charette (added)


Comment:

 Vishal Pandey, if you're looking for pointers on how to resolve the issue
 I think I have a pretty good understanding of the problem.

 The root cause is that both queries happen to share the same
 `alias_prefix`; the letter used generate aliases when the same table is
 referenced more than once in a query.

 We already have a method that does all of the heavy lifting to prevent
 these collisions that the ORM uses when subqueries are involved which is
 `Query.bump_prefix` but it's not entirely applicable here. I think the
 best way forward here is to change the `alias_prefix` of the `rhs` and
 change its alias accordingly so it doesn't conflict before proceeding with
 the creation of the `change_map`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33319#comment:4>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/072.b64c9483407ac34a2e0e4b0b6b33c4a1%40djangoproject.com.

Reply via email to