#31922: QuerySet.filter() against Q() with Subquery() and __in produces wrong
results.
-------------------------------------+-------------------------------------
     Reporter:  Chris Bell           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  orm, subquery, q,    |             Triage Stage:  Accepted
  order                              |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Chris Bell):

 Hi @felixmm et al.

 Thanks for confirming the issue and suggestion for using Exists.

 The concern for us is how wide reaching this problem is. Ideally our tests
 would catch erroneous SQL but that is not guaranteed and we are concerned
 as to the possibility of security related issues arising from a similar
 scenario.

 We are looking into ways of trying to identify examples of our Q usages
 that may be susceptible to this problem. In the meantime, if anyone in the
 community has any tips/thoughts on where this issue may originate, we
 would love to hear from you. We may be able to help investigate it with a
 bit of assistance, specifically from those with experience of the inner
 workings of the ORM.

 Many thanks in advance

 Chris

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31922#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 on the web visit 
https://groups.google.com/d/msgid/django-updates/066.57c7938be0aa410de50a4e77b52ac8f9%40djangoproject.com.

Reply via email to