Changes between Initial Version and Version 1 of Ticket #36388, comment 10


Ignore:
Timestamp:
May 15, 2025, 2:58:25 PM (4 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36388, comment 10

    initial v1  
    33Please have a look at [https://github.com/django/django/pull/19471#discussion_r2091852049 this comment]. The fact the tests are passing is not a good indicative that the right thing is happening here as the adjusted test I provided demonstrates (it does a `UNION` against itself which is not safe when `all` is used).
    44
    5 I still believe that the right way of fixing this is to adjust `QuerySet.union` to return `self` when `not other_qs`.
     5I still believe that the right way of fixing this is to adjust `QuerySet.union` to return `self` when `not other_qs` as the compilation layer is not equipped to deal with an empty combination of queries and it's just faster to avoid the query cloning if we can.
Back to Top