-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Fixed #28378 -- Fixed union(), and difference() when combining with queryset raising EmptyResultSet exception. #8721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
django/db/models/sql/compiler.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't checked out the patch locally but were these changes necessary for the patch to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. EmptyResultSet exception is raised here, therefore I decided to move these variables inside the if clause where they are used.
892a379 to
639cd33
Compare
|
@charettes Thanks for review. I added release notes. |
docs/releases/1.11.4.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chop comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with a queryset
docs/releases/1.11.4.txt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"exception" seems unneeded
django/db/models/sql/compiler.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with UNION and with DIFFERENCE if the first queryset is nonempty.
django/db/models/sql/compiler.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd chop the blank lines around for_update_part.
django/db/models/sql/compiler.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd omit the blank lines.
|
@timgraham Thanks for review. |
…queryset raising EmptyResultSet. Thanks Jon Dufresne for the report. Thanks Tim Graham and Simon Charette for the reviews.
https://code.djangoproject.com/ticket/28378