| Age | Commit message (Collapse) | Author |
|
lookups.
Non-tuple exact and in lookups have specialized logic for subqueries that can
be adapted to properly assign select mask if unspecified and ensure the number
of involved members are matching on both side of the operator.
Backport of 41239fe34d64e801212dccaa4585e4802d0fac68 from main.
|
|
Regression in bf7b17d16d3978b2e1cee4a0f7ce8840bd1a8dc4.
Thanks Sage Abdullah for the report.
|
|
models and DateTimeField annotations.
Ticket was resolved by 65ad4ade74dc9208b9d686a451cd6045df0c9c3a as part of #28900.
|
|
on PostgreSQL 17+.
|
|
Just like normal queries, combined queries' outer references might fully
resolve before their reference is assigned its final alias.
Refs #29338.
Thanks Antony_K for the report and example, and thanks Mariusz Felisiak
for the review.
|
|
unusable state.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
|
|
While refs #34125 focused on the SQL correctness of slicing of union of
potentially empty queries it missed an optimization opportunity to avoid
performing a query at all when all queries are empty.
Thanks Lucidiot for the report.
|
|
Previously, only the selected column aliases would be propagated and
annotations were ignored.
|
|
Previously the order was always extra_fields + model_fields + annotations with
respective local ordering inferred from the insertion order of *selected.
This commits introduces a new `Query.selected` propery that keeps tracks of the
global select order as specified by on values assignment. This is crucial
feature to allow the combination of queries mixing annotations and table
references.
It also allows the removal of the re-ordering shenanigans perform by
ValuesListIterable in order to re-map the tuples returned from the database
backend to the order specified by values_list() as they'll be in the right
order at query compilation time.
Refs #28553 as the initially reported issue that was only partially fixed
for annotations by d6b6e5d0fd4e6b6d0183b4cf6e4bd4f9afc7bf67.
Thanks Mariusz Felisiak and Sarah Boyce for review.
|
|
Thank you to Mariusz Felisiak and Natalia Bidart for the reviews.
|
|
co-authored-by: Gordon <gordon.wrigley@gmail.com>
co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
operators.
Thanks Alan for the report.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
|
|
Thanks Eugene Morozov and Ben Nace for the reports.
|
|
The implementation of some core types differ between CPython and PyPy
and this may affect the way that pickling works such that errors are
raised in differing locations in the interpreter or not at all.
Use our own custom non-pickleable type instead to avoid these quirks.
|
|
PostgreSQL 16+.
|
|
|
|
dict_keys.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
Slice on unordered subquery may be non-deterministic in some databases.
|
|
The outer query reference is not necessary when alias can be reused and
can even be harmful by confusing query planers.
Refs #34597.
|
|
QuerySet.values()/values_list() on compound queries.
Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
|
|
This was fixed in MySQL 8.0.31.
|
|
Regression in 3d734c09ff0138441dfe0a59010435871d17950f.
Thanks Raphaël Stefanini for the report.
|
|
filters.
Per deprecation timeline.
|
|
|
|
Passing None to params causes errors in determining the data type on
psycopg3.
|
|
select_related().
Thanks Simon Charette for noticing this.
Fixed in 70499b25c708557fb9ee2264686cd172f4b2354e.
|
|
Regression in c58a8acd413ccc992dd30afd98ed900897e1f719.
Thanks to Shai Berger for the report and tests.
Co-Authored-By: David Sanders <shang.xiao.sanders@gmail.com>
|
|
Adjusting WhereNode.as_sql() to raise an exception when encoutering a
full match just like with empty matches ensures that all case are
explicitly handled.
|
|
|
|
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.
|
|
assertQuerySetEqual().
Co-Authored-By: Michael Howitz <mh@gocept.com>
|
|
where appropriate.
Follow up to 3f7b3275627385f8f7531fca01cdda50d4ec6b6e.
|
|
MySQL.
Columns of the left outer most select statement in a combined query
can be referenced by alias just like by index.
This removes combined query ordering by column index and avoids an
unnecessary usage of RawSQL which causes issues for backends that
specialize the treatment of null ordering.
|
|
for models with Meta.ordering.
This makes QuerySet.order_by() no longer ignore trailing transforms for
models with Meta.ordering. As a consequence, FieldError is raised in
such cases for non-existent fields.
Thanks to Klaas van Schelven for the report and Mariusz Felisiak for the
review and advice.
|
|
|
|
|
|
This ensures field deferral works properly when a model is involved
more than once in the same query with a distinct deferral mask.
|
|
Node.create() which has a compatible signature with Node.__init__()
takes in a single `children` argument rather than relying in unpacking
*args in Q.__init__() which calls Node.__init__().
In addition, we were often needing to unpack iterables into *args and
can instead pass a list direct to Node.create().
|
|
|
|
on PostgreSQL and MySQL.
Thanks Shai Berger for the report.
Regression in 30a01441347d5a2146af2944b29778fa0834d4be.
|
|
|
|
|
|
|
|
|
|
format is uppercased.
Follow up to aba9c2de669dcc0278c7ffde7981be91801be00b.
|
|
It accounts for differences seen on MySQL with MyISAM storage engine.
|
|
that don't support transactions.
|