| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
While deferring many-to-many and GFK has no effect, the previous
implementation of QuerySet.defer() ignore them instead of crashing.
Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.
Thanks Paco Martínez for the report.
|
|
|
|
| |
It was a copy of sql.Query._add_q that avoided JOIN updates.
|
|
|
|
|
|
|
|
|
|
|
| |
The previous implementation resolved condition at Join compilation time
which required introducing a specialized expression resolving mode to
alter the join reuse logic solely during that phase.
FilteredRelation.condition is now resolved when the relation is first
referenced which maintains the existing behavior while allowing the
removal of the specialized resolving mode and address an issue where
conditions couldn't spawn new joins.
|
|
|
|
|
|
|
|
| |
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.
Refs #28477.
Thanks Ian Cubitt for the report.
|
|
|
|
|
|
| |
Thanks Andrew Cordery for the report.
Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.
|
|
|
|
| |
Thanks Roman Odaisky for the report.
|
|
|
| |
Bug in cd1afd553f9c175ebccfc0f50e72b43b9604bd97.
|
|
|
|
|
| |
While the add_fields() call from set_values() does trigger validation it
does so after annotations are masked resulting in them being excluded
from the choices of valid options surfaced through a FieldError.
|
|
|
|
|
|
| |
QuerySet.values()/values_list() on compound queries.
Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Regression in b7b28c7c189615543218e81319473888bc46d831.
Refs #31377.
Thanks Shai Berger for the report and reviews.
test_aggregation_subquery_annotation_values_collision() has been
updated as queries that are explicitly grouped by a subquery should
always be grouped by it and not its outer columns even if its alias
collides with referenced table columns. This was not possible to
accomplish at the time 10866a10 landed because we didn't have compiler
level handling of colliding aliases.
|
|
|
|
|
|
|
| |
to JSONField & co.
JSON should be provided as literal Python objects an not in their
encoded string literal forms.
|
|
|
|
|
|
|
|
|
|
| |
By avoiding to annotate aggregations meant to be possibly pushed to an
outer query until their references are resolved it is possible to
aggregate over a query with the same alias.
Even if #34176 is a convoluted case to support, this refactor seems
worth it given the reduction in complexity it brings with regards to
annotation removal when performing a subquery pushdown.
|
|
|
|
|
| |
The latter offers a more generic interface that doesn't require
specialized expression types handling.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Just like when using .annotate(), the .alias() method will generate the
necessary JOINs to resolve the alias even if not selected.
Since these JOINs could be multi-valued non-selected aggregates must be
considered to require subquery wrapping as a GROUP BY is required to
combine duplicated tuples from the base table.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.
|
| |
|
|
|
|
|
| |
Also avoid an unnecessary pushdown when aggregating over a query that doesn't
have aggregate annotations.
|
|
|
|
|
|
| |
Identified using the following command:
$ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
|
|
|
|
|
| |
Recent refactors allowed GROUP BY aliasing allowed for aliasing to be
entirely handled by the sql.Query.set_group_by and compiler layers.
|
|
|
|
|
|
|
|
|
|
|
| |
This required moving the combined queries slicing logic to the compiler
in order to allow Query.exists() to be called at expression resolving
time.
It allowed for Query.exists() to be called at Exists() initialization
time and thus ensured that get_group_by_cols() was operating on the
terminal representation of the query that only has a single column
selected.
|
|
|
|
|
|
|
| |
This ensures explicit grouping from using values() before annotating an
aggregate function groups by selected aliases if supported.
The GROUP BY feature is disabled on Oracle because it doesn't support it.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
alias().
This fixes clearing selected fields.
|
|
|
|
|
| |
This ensures field deferral works properly when a model is involved
more than once in the same query with a distinct deferral mask.
|
| |
|
|
|
|
| |
models.
|
|
|
|
| |
used in subquery on Oracle.
|
| |
|
|
|
|
| |
QuerySet.exists().
|
|
|
|
| |
distinct querysets.
|
|
|
|
| |
injection on PostgreSQL.
|
|
|
|
|
|
|
|
| |
extra() against SQL injection in column aliases.
Thanks Splunk team: Preston Elder, Jacob Davis, Jacob Moore,
Matt Hanson, David Briggs, and a security researcher: Danylo Dmytriiev
(DDV_UA) for the report.
|
|
|
|
| |
Query.deferred_to_data()'s callback argument.
|
|
|
|
|
|
| |
get_loaded_field_names() is no longer called in multiple places
(see 0c7633178fa9410f102e4708cef979b873bccb76) and it's redundant
with SQLCompiler.deferred_to_columns().
|
|
|
|
|
|
|
|
|
| |
argument from Query methods."
Thanks lind-marcus for the report.
This reverts commit 0c71e0f9cfa714a22297ad31dd5613ee548db379.
Regression in 0c71e0f9cfa714a22297ad31dd5613ee548db379.
|
| |
|
| |
|
|
|
|
| |
attributes to class attributes.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In these cases Black produces unexpected results, e.g.
def make_random_password(
self,
length=10,
allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):
or
cursor.execute("""
SELECT ...
""",
[table name],
)
|
|
|
|
| |
Thanks Eugene Kovalev for the initial patch, Simon Charette for the
review, and Chetan Khanna for help.
|
|
|
|
| |
with aliases that conflict.
|
|
|
|
| |
Query.change_aliases().
|
| |
|
|
|
|
|
|
|
|
| |
As a QuerySet resolves to Query the outer column references grouping logic
should be defined on the latter and proxied from Subquery for the cases where
get_group_by_cols is called on unresolved expressions.
Thanks Antonio Terceiro for the report and initial patch.
|
|
|
|
| |
SQLCompiler.
|