| Age | Commit message (Collapse) | Author |
|
Thanks Simon Charette and Mariusz Felisiak for reviews and mentoring
this Google Summer of Code 2022 project.
|
|
This ensures field deferral works properly when a model is involved
more than once in the same query with a distinct deferral mask.
|
|
|
|
-Inf values.
|
|
instances.
Thanks Claude Paroz for the report.
Regression in 7ba6ebe9149ae38257d70100e8bfbfd0da189862.
|
|
Models that use SET, SET_NULL, and SET_DEFAULT as on_delete handler
don't have to fetch objects for the sole purpose of passing them back to
a follow up UPDATE query filtered by the retrieved objects primary key.
This was achieved by flagging SET handlers as _lazy_ and having the
collector logic defer object collections until the last minute. This
should ensure that the rare cases where custom on_delete handlers are
defined remain uncalled when when dealing with an empty collection of
instances.
This reduces the number queries required to apply SET handlers from
2 to 1 where the remaining UPDATE use the same predicate as the non
removed SELECT query.
In a lot of ways this is similar to the fast-delete optimization that
was added in #18676 but for updates this time. The conditions only
happen to be simpler in this case because SET handlers are always
terminal. They never cascade to more deletes that can be combined.
Thanks Renan GEHAN for the report.
|
|
Model instances retrieved for bulk field update purposes are not exposed
to the outside world and thus are not required to be kept update to
date.
|
|
|
|
|
|
This was made possible by window function filtering support added in
f387d024fc75569d2a4a338bfda76cc2f328f627.
|
|
Adds support for joint predicates against window annotations through
subquery wrapping while maintaining errors for disjointed filter
attempts.
The "qualify" wording was used to refer to predicates against window
annotations as it's the name of a specialized Snowflake extension to
SQL that is to window functions what HAVING is to aggregates.
While not complete the implementation should cover most of the common
use cases for filtering against window functions without requiring
the complex subquery pushdown and predicate re-aliasing machinery to
deal with disjointed predicates against columns, aggregates, and window
functions.
A complete disjointed filtering implementation should likely be
deferred until proper QUALIFY support lands or the ORM gains a proper
subquery pushdown interface.
|
|
This extends query composability possibilities when dealing with
subqueries which is necessary to implement window function filtering.
|
|
The latter allows for more generic use cases beyond the currently
limited ones constraints validation has.
Refs #28333, #30581.
|
|
When() on Oracle.
Follow up to 036bb2b74afb50a71e7a945e8dd83499b603ac3a.
|
|
Thanks shukryzablah for the report.
|
|
Thanks Adam Zahradník for the report.
Bug in 667105877e6723c6985399803a364848891513cc.
|
|
Thanks Kia for the report.
Regression in e06dc4571ea9fd5723c8029959b95808be9f8812.
|
|
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().
|
|
- Removed use of Q.deconstruct() in Q._combine().
- Simplified and optimized Q.__invert__() by taking a shallow copy and
swapping the negated attribute only.
- Simplified construction in Q._combine().
- Simplified conditions in Q._combine() as Q.conditional = True the
first isinstance() check is unnecessary.
- Removed copy.copy() branch in Q._combine().
Co-authored-by: Keryn Knight <keryn@kerynknight.com>
|
|
This allows the copy.copy() usage in the Q._combine() method to finish
sooner, instead of having to fallback to using the __reduce_ex__(4)
method.
Thia also avoids having to fall into copy.copy() at in Q._combine(),
when combining a Q() with another Q().
Co-authored-by: Keryn Knight <keryn@kerynknight.com>
|
|
We can use copy() in Node.add() instead of create() as we don't need the
children to be cloned via [:] subscript in __init__().
|
|
Node._new_instance() was added in
6dd2b5468fa275d53aa60fdcaff8c28bdc5e9c25 to work around Q.__init__()
having an incompatible signature with Node.__init__().
It was intended as a hook that could be overridden if subclasses needed
to change the behaviour of instantiation of their specialised form of
Node. In practice this doesn't ever seem to have been used for this
purpose and there are very few calls to Node._new_instance() with other
code, e.g. Node.__deepcopy__() calling Node and overriding __class__ as
required.
Rename this to Node.create() to make it a more "official" piece of
private API that we can use to simplify a lot of other areas internally.
The docstring and nearby comment have been reworded to read more
clearly.
|
|
Node.subtree_parents was removed in
d3f00bd5706b35961390d3814dd7e322ead3a9a3. That commit also added
Q.clone() which was identical to WhereNode.clone(), but lacked the
docstring. Q.clone() was later removed in
b454e2cbc95eb26fa0c32b54c53ae24fc40e8c02.
|
|
|
|
DeprecationForHistoricalMigrationMixin."
This reverts commit 57793b47657ace966ce8ce96d801ac0d85e5efc6.
|
|
This should make it more straightforward to move forward when
deprecation ends.
|
|
This also deprecates AlterIndexTogether migration operation.
|
|
violation_error_message.
Regression in 667105877e6723c6985399803a364848891513cc.
|
|
|
|
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
SQL injection.
Thanks Takuto Yoshikai (Aeye Security Lab) for the report.
|
|
models.
|
|
used in subquery on Oracle.
|
|
on PostgreSQL and MySQL.
Thanks Shai Berger for the report.
Regression in 30a01441347d5a2146af2944b29778fa0834d4be.
|
|
QuerySeta.abulk_create().
|
|
|
|
queryset with aggregation.
|
|
|
|
|
|
parent.
Thanks Barry Johnson for the report.
|
|
Thanks Florian Apolloner for the report.
Thanks Simon Charette for the review.
|
|
Forward port of d1f1a0168ab8a2556980ec1410512b5f02502da4 from
stable/4.1.x.
|
|
|
|
and Expression.asc()/desc().
Thanks Allen Jonathan David for the initial patch.
|
|
contains expressions.
Thanks Simon Charette for the review.
|
|
Thanks Simon Charette, Keryn Knight, and Mariusz Felisiak for reviews.
|
|
|
|
Until we add support for truly asynchronous database backends it's
actually detrimental to have complete set retrieval require multiple
hops between sync and async emulated contexts via asgiref.
By defaulting to sending the whole sync _fetch_all() to the current
context thread pool we reduce unncessary work when dealing with large
result sets since the queryset cannot be iterated anyway before all
results are retrieved and cached.
|
|
|
|
|