* cc: Simon Charette (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted
Comment:
Thanks for the report! I attached a regression test which generates the
following SQL on PostgreSQL:
{{{#!sql
(SELECT "queries_number"."id",
"queries_number"."num",
"queries_number"."other_num",
"queries_number"."another_num"
FROM "queries_number"
WHERE "queries_number"."num" <= 0
LIMIT 1)
LIMIT 1;
}}}
Regression in 3d734c09ff0138441dfe0a59010435871d17950f.
Reproduced at de2c2127b66e77a034c01c81753c5c08e651a5b4.
--
Ticket URL: <https://code.djangoproject.com/ticket/34125#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Simon Charette
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/34125#comment:4>
* Attachment "test-34125.diff" added.
Regression test.
--
Ticket URL: <https://code.djangoproject.com/ticket/34125>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34125#comment:5>
Comment (by Simon Charette):
The patch in its current form should address the reported issue and also
cover other use cases that were not covered when dealing with slicing
combined queries that are sliced themselves.
--
Ticket URL: <https://code.djangoproject.com/ticket/34125#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"c2cc80756b8949cdd87b88bbfdfee698ced441e0" c2cc807]:
{{{
#!CommitTicketReference repository=""
revision="c2cc80756b8949cdd87b88bbfdfee698ced441e0"
Fixed #34125 -- Fixed sliced QuerySet.union() crash on a single non-empty
queryset.
The bug existed since sliced query union was added but was elevated to
query union slices by moving the .exists() optimization to the compiler
in 3d734c09ff0138441dfe0a59010435871d17950f.
Thanks Stefan Hammer for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34125#comment:7>