#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
-------------------------------------+-------------------------------------

Comment (by Ömer Faruk Abacı):

 Replying to [comment:3 Mariusz Felisiak]:
 > Thanks for the report. Reproduced at
 b8c0b22f2f0f8ce664642332d6d872f300c662b4.

 Thanks for your quick reply, but the commit you have mentioned doesn't
 seem related. By the way, can I open a PR for adding myself to AUTHORS?

 Replying to [comment:4 Simon Charette]:
 > 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`.

 I totally agree with you. My initial attempt was to use
 `Query.bump_prefix` but as you told it threw an error.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33319#comment:5>
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.9a7d821f6673ecb19ca4d3c176098836%40djangoproject.com.

Reply via email to