1
0
mirror of https://github.com/django/django.git synced 2025-03-14 11:20:46 +00:00

5581 Commits

Author SHA1 Message Date
Simon Charette
d660cee5bc Fixed #33766 -- Resolved FilteredRelation.condition at referencing time.
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.
2023-04-24 08:32:44 +02:00
Petter Friberg
8ed25d65ea Fixed #34505 -- Skipped varchar_pattern_ops/text_pattern_ops index creation when db_collation is set in related field. 2023-04-21 10:31:22 +02:00
David Wobrock
8b1ff0da4b Refs #16055 -- Deprecated get_joining_columns()/get_reverse_joining_columns() methods. 2023-04-18 12:46:27 +02:00
David Wobrock
9bbf97bcdb Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation relation on PostgreSQL. 2023-04-18 12:41:14 +02:00
Scott Macpherson
53aee470d5 Fixed #34486 -- Fixed DatabaseOperations.compose_sql() crash with no existing database connection on PostgreSQL.
Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
2023-04-14 10:11:33 +02:00
Jacob Walls
c3d7a71f83 Fixed #34480 -- Fixed crash of annotations with Chr(). 2023-04-11 05:56:47 +02:00
Mariusz Felisiak
5b8a043bf5
Fixed #34470 -- Enforced UTF-8 encoding on PostgreSQL.
Regression in 6a2165816394ab4bb259f6171e82417e098e97a6.
2023-04-07 10:11:41 +02:00
Anders Kaseorg
73cbb372ba Fixed #34466 -- Reallowed setting cursor_factory in DATABASES["options"] on PostgreSQL.
Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
2023-04-07 08:02:34 +02:00
Simon Charette
9daf8b4109 Fixed #34464 -- Fixed queryset aggregation over group by reference.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.

Refs #28477.

Thanks Ian Cubitt for the report.
2023-04-07 06:57:32 +02:00
Simon Charette
87c63bd8df Fixed #34458 -- Fixed QuerySet.defer() crash on attribute names.
Thanks Andrew Cordery for the report.

Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.
2023-04-05 05:38:10 +02:00
Simon Charette
0e1aae7a5f Fixed #34450 -- Fixed multi-valued JOIN reuse when filtering by expressions.
Thanks Roman Odaisky for the report.
2023-04-04 14:35:21 +02:00
Tim Graham
465f3c045b
Prevented PostgreSQL's DatabaseCreation._execute_create_test_db() from hiding clause-less exceptions.
Regression in 3cafb783f3f711c7413ba2b8d7c8ff750bd4d6e1.
2023-04-03 05:54:34 +02:00
Mariusz Felisiak
996c802229
Fixed #34443 -- Fixed filtering by transforms on reverse relations.
Regression in ce6230aa976e8d963226a3956b45a8919215dbd8.
2023-03-28 21:03:24 +02:00
Mariusz Felisiak
3afdc9e9b4
Refs #29799 -- Added field instance lookups to suggestions in FieldErrors.
Bug in cd1afd553f9c175ebccfc0f50e72b43b9604bd97.
2023-03-28 19:18:48 +02:00
Simon Charette
cb13792938
Fixed #34437 -- Made values() resolving error mention selected annotations.
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.
2023-03-25 20:22:45 +01:00
David Wobrock
d6b6e5d0fd Fixed #28553 -- Fixed annotation mismatch with QuerySet.values()/values_list() on compound queries.
Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
2023-03-24 06:09:27 +01:00
T. Franzel
a2eaea8f22 Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00
Liyang Zhang
f9f9215d3e
Fixed some typos in comments, docstrings, and tests. 2023-03-20 08:07:23 +01:00
Andy Chosak
b295b31171 Fixed #34420 -- Corrected the order of imports in generated migration files. 2023-03-20 06:23:08 +01:00
hb6h057
2ffa815c73 Fixed #34421 -- Fixed QuerySet.update() on querysets in descending order by annotations. 2023-03-18 13:19:40 +01:00
David Wobrock
de0c7744be Refs #28329 -- Fixed Cast() with ForeignKey to integer fields on MySQL. 2023-03-14 08:32:17 +01:00
Durval Carvalho
4b1bfea284 Fixed #34333 -- Fixed migration operations ordering when adding index/constraint on new foreign key.
Thanks Simon Charette and David Wobrock for reviews.
2023-03-10 07:05:11 +01:00
Simon Charette
dde2537fbb Fixed #27397 -- Prevented integer overflows on integer field lookups.
This prevents a sqlite3 crash and address a potential DDoS vector on
PostgreSQL caused by full-table-scans on overflows.
2023-03-09 15:55:10 +01:00
nabil-rady
32d4b61c31 Fixed #34370 -- Added integer fields validation as 64-bit on SQLite. 2023-03-08 11:52:57 +01:00
Ekaterina Vahrusheva
55bcbd8d17 Fixed #34378 -- Made QuerySet.in_bulk() not clear odering when id_list is passed.
This reverts 340eaded4e30cf25bcd4e9781d33a617fe9c0f84.
2023-03-03 06:00:10 +01:00
Mariusz Felisiak
9953c804a9
Refs #34320 -- Stopped recreating check constraints when renaming fields.
This also fixes test_rename_field_with_check_to_truncated_name() on
MariaDB 10.5.2+ as ALTER TABLE ... RENAME COLUMN statement doesn't
rename inline constraints.
2023-03-02 06:05:40 +01:00
Simon Charette
c67ea79aa9 Fixed #34368 -- Made subquery raise NotSupportedError when referencing outer window expression.
Regression in f387d024fc75569d2a4a338bfda76cc2f328f627.

Co-authored-by: Jannis Vajen <jvajen@gmail.com>
2023-02-27 07:18:58 +01:00
Simon Charette
b15f162f25
Fixed #34372 -- Fixed queryset crash on order by aggregation using OrderBy.
Regression in 278881e37619278789942513916acafaa88d26f3 caused by a lack
of expression copying when an OrderBy expression is explicitly provided.

Thanks Jannis Vajen for the report and regression test.
2023-02-27 07:10:19 +01:00
Laurent Tramoy
2276ec8c21 Fixed #34366 -- Reduced AlterField operations when optimizing migrations. 2023-02-24 13:59:42 +01:00
Mariusz Felisiak
16c966ff7f
Refs #30060, Refs #34217 -- Made SchemaEditor not generate SQL for CheckConstraint if not supported.
The new logic mirrors the logic in SchemaEditor._delete_check_sql()
added in 68ef274bc505cd44f305c03cbf84cf08826200a8.

Thanks Tim Graham for the report.
2023-02-23 21:12:17 +01:00
Xavier Fernandez
5b3d3e400a Fixed #34338 -- Allowed customizing code of ValidationError in BaseConstraint and subclasses. 2023-02-23 10:58:20 +01:00
Xavier Fernandez
51c9bb7cd1 Refs #33829 -- Added violation_error_message to constraints' __repr__(). 2023-02-23 05:35:58 +01:00
Xavier Fernandez
ad18a0102c Fixed #34355 -- Deprecated passing positional arguments to BaseConstraint. 2023-02-22 09:37:58 +01:00
Mariusz Felisiak
96bc4254ee
Refs #31445 -- Added test for nesting QuerySet.union().
This was fixed in MySQL 8.0.31.
2023-02-21 12:47:52 +01:00
Simon Charette
278881e376 Fixed #34346 -- Ordered selected expressions by position.
Used the same approach as for #34176 by using selected expressions
position to prevent ambiguous aliases in collisions.

Thanks henribru for the report.

Regression in 04518e310d4552ff7595a34f5a7f93487d78a406.
2023-02-20 05:54:25 +01:00
Simon Charette
f91e085c30 Refs #34176 -- Adjusted group by position variables naming to follow SQL spec.
This avoids conceptual collisions with the notion of indices.
2023-02-18 18:42:49 -05:00
nabil-rady
6bdc3c58b6 Fixed #34320 -- Make sure constraints names are obtained from truncated columns names. 2023-02-15 16:51:31 +01:00
DevilsAutumn
ff3a283422 Fixed #34250 -- Fixed renaming model with m2m relation to a model with the same name. 2023-02-14 14:08:06 +01:00
tschilling
c5808470aa Fixed #34280 -- Allowed specifying different field values for create operation in QuerySet.update_or_create(). 2023-02-14 11:50:35 +01:00
Mariusz Felisiak
2fd755b361
Fixed #34319 -- Fixed Model.validate_constraints() crash on ValidationError with no code.
Thanks Mateusz Kurowski for the report.

Regression in 667105877e6723c6985399803a364848891513cc.
2023-02-08 16:38:55 +01:00
Dan Glass
bd366ca2ae
Made PostgreSQL's SchemaEditor._create_index_sql() respect the "sql" argument. 2023-02-06 10:41:08 +01:00
David Smith
097e3a70c1 Refs #33476 -- Applied Black's 2023 stable style.
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.

https://github.com/psf/black/releases/tag/23.1.0
2023-02-01 11:04:38 +01:00
sag᠎e
110b3b8356
Fixed #34304 -- Made MySQL's SchemaEditor.remove_constraint() don't create foreign key index when unique constraint is ignored.
Regression in b731e8841558ee4caaba766c83f34ea9c7004f8b.
2023-01-31 11:52:07 +01:00
Mariusz Felisiak
82dad11bfe
Refs #34255 -- Skipped test_group_by_nested_expression_with_params test on PostgreSQL when server-side binding cursors are used.
Thanks Tim Graham for the review.
2023-01-27 21:28:10 +01:00
Raj Desai
246eb4836a Fixed #34254 -- Fixed return value of Exists() with empty queryset.
Thanks Simon Charette for reviews.
2023-01-26 19:54:48 +01:00
Mariusz Felisiak
2b1242abb3
Fixed #34291 -- Fixed Meta.constraints validation crash on UniqueConstraint with ordered expressions.
Thanks Dan F for the report.

Bug in 667105877e6723c6985399803a364848891513cc.
2023-01-26 09:31:40 +01:00
朱穆穆
d3c93cdc59 Fixed #34227 -- Fixed QuerySet.select_related() with multi-level FilteredRelation. 2023-01-24 10:20:27 +01:00
Matt Westcott
ef85b6bf0b Fixed #34192 -- Preserved callable storage when it returns default_storage. 2023-01-23 10:29:17 +01:00
Francesco Panico
cc8aa6bf9c Fixed #34267 -- Fixed sliced QuerySet.union() crash.
Regression in 3d734c09ff0138441dfe0a59010435871d17950f.

Thanks Raphaël Stefanini for the report.
2023-01-20 08:51:38 +01:00
Nick Pope
39f83765e1 Refs #32528 -- Simplified MigrationAutodetector._sort_migrations(). 2023-01-19 06:34:28 +01:00