summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2024-11-06Fixed #35778 -- Used JSON_OBJECT database function on PostgreSQL 16+ with ↵John Parton
server-side bindings.
2024-11-06Removed definition of JSONObject ArgJoiner class in as_native function.Sarah Boyce
2024-11-04Refs #373 -- Added TupleIn subqueries.Bendeguz Csirmaz
2024-11-01Fixed #35837 -- Added missing alters_data=True to QuerySet and UserManager ↵Sarah Boyce
methods. Thank you to Jason Chambers for the report and to Mariusz Felisiak for the review.
2024-10-31Fixed #35180 -- Recreated PostgreSQL _like indexes when changing between ↵Ben Cail
TextField and CharField field types.
2024-10-30Fixed #35856 -- Added QuerySet.explain() support for MEMORY/SERIALIZE option ↵Anthony Joseph
on PostgreSQL 17+.
2024-10-14Fixed #35744 -- Relabelled external aliases of combined queries.Simon Charette
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.
2024-10-14Refs #373 -- Added additional validations to tuple lookups.Bendeguz Csirmaz
2024-10-10Fixed #35103 -- Used provided error code and message when fields is set ↵gabn88
without a condition on UniqueConstraint.
2024-09-26Refs #373 -- Added support for using tuple lookups in filters.Bendeguz Csirmaz
2024-09-26Fixed #35734 -- Used JSONB_BUILD_OBJECT database function on PostgreSQL when ↵John Parton
using server-side bindings. Regression in 81ccf92f154c6d9eac3e30bac0aa67574d0ace15.
2024-09-20Refs #373 -- Updated TupleIsNull lookup to check if any is NULL rather than all.Bendeguz Csirmaz
Regression in 1eac690d25dd49088256954d4046813daa37dc95.
2024-09-17Refs #373, Refs #24121 -- Added ColPairs.__repr__().Bendeguz Csirmaz
2024-09-17Fixed #35762 -- Avoided unneeded quote_name() calls in SQLite introspection.Claude Paroz
Double-quoting string literals is deprecated in recent SQLite versions. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-09-16Fixed #34887 -- Added support for unlimited models.CharField on SQLite.saJaeHyukc
Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
2024-09-11Refs #373 -- Removed outdated comment in RelatedIn lookup.Csirmaz Bendegúz
2024-09-11Fixed #35732 -- Wrapped ConcatPair expression in parentheses to ensure ↵Gastón Avila
operator precedence. When ConcatPair was updated to use || this lost the implicit wrapping from CONCAT(...). This broke the WHERE clauses when used in combination with PostgreSQL trigram similarity. Regression in 6364b6ee1071381eb3a23ba6b821fc0d6f0fce75. Co-authored-by: Emiliano Cuenca <106986074+emicuencac@users.noreply.github.com>
2024-09-11Fixed #35752 -- Fixed crash when using In() lookup in filters.Bendeguz Csirmaz
2024-09-11Refs #373 -- Refactored variable assignments in ColPairs and tuple lookups.Bendeguz Csirmaz
2024-09-11Refs #373 -- Improved test coverage of tuple lookup checks.Bendeguz Csirmaz
This also removed unreachable checks.
2024-09-09Refs #373 -- Added Model._is_pk_set() abstraction to check if a Model's PK ↵Csirmaz Bendegúz
is set.
2024-09-09Refs #33817 -- Corrected errors raised when Oracle driver is not installed.Mariusz Felisiak
oracledb_any should reraise ImportError instead of raising ImproperlyConfigured.
2024-09-03Fixed #35704 -- Fixed reduction for AddIndex subclasses.Adam Johnson
2024-09-02Fixed #35712 -- Prevented Q.check() from leaving the connection in an ↵Alex Fischer
unusable state. Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-09-02Fixed #35690 -- Errored nicely when using in_bulk() with a values() or ↵John Parton
values_list() queryset.
2024-08-30Fixed #35700 -- Added AlterModelTable and AlterModelTableComment reductions.Adam Johnson
2024-08-28Fixed #35688 -- Restored timezone and role setters to be PostgreSQL ↵Sarah Boyce
DatabaseWrapper methods. Following the addition of PostgreSQL connection pool support in Refs #33497, the methods for configuring the database role and timezone were moved to module-level functions. This change prevented subclasses of DatabaseWrapper from overriding these methods as needed, for example, when creating wrappers for other PostgreSQL-based backends. Thank you Christian Hardenberg for the report and to Florian Apolloner and Natalia Bidart for the review. Regression in fad334e1a9b54ea1acb8cce02a25934c5acfe99f. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-08-28Refs #35405 -- Adjusted deprecation warning stacklevel in ↵Simon Charette
FieldCacheMixin.get_cache_name().
2024-08-28Refs #35060 -- Adjusted deprecation warning stacklevel in Model.save()/asave().Simon Charette
2024-08-28Refs #34547 -- Adjusted deprecation warning stacklevel in ↵Simon Charette
DatabaseOperations.field_cast_sql().
2024-08-28Refs #16055 -- Adjusted deprecation warning stacklevel in ↵Simon Charette
get_joining_columns()/get_reverse_joining_columns().
2024-08-28Refs #12581 -- Adjusted warning stacklevel in queries ring buffer.Simon Charette
2024-08-13Fixed #35665 -- Fixed a crash when passing an empty order_by to Window.Simon Charette
This also caused un-ordered sliced prefetches to crash as they rely on Window. Regression in e16d0c176e9b89628cdec5e58c418378c4a2436a that made OrderByList piggy-back ExpressionList without porting the empty handling that the latter provided. Supporting explicit empty ordering on Window functions and slicing is arguably a foot-gun design due to how backends will return undeterministic results but this is a problem that requires a larger discussion. Refs #35064. Thanks Andrew Backer for the report and Mariusz for the review.
2024-08-12Fixed #35586 -- Added support for set-returning database functions.Devin Cox
Aggregation optimization didn't account for not referenced set-returning annotations on Postgres. Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-08-12Fixed #35575 -- Added support for constraint validation on GeneratedFields.Mark Gensler
2024-08-06Fixed CVE-2024-42005 -- Mitigated QuerySet.values() SQL injection attacks ↵Simon Charette
against JSON fields. Thanks Eyal (eyalgabay) for the report.
2024-08-05Fixed #35657 -- Made FileField handle db_default values.Sarah Boyce
2024-08-05Fixed #35638 -- Updated validate_constraints to consider db_default.David Sanders
2024-08-05Refs #35638 -- Avoided wrapping expressions with Value in ↵David Sanders
_get_field_value_map() and renamed to _get_field_expression_map().
2024-08-03Fixed #35655 -- Reverted "Fixed #35295 -- Used INSERT with multiple rows on ↵Sarah Boyce
Oracle 23c." This reverts commit 175b04942afaff978013db61495f3b39ea12989b due to a crash when Oracle > 23.3.
2024-08-02Fixed #35643 -- Fixed a crash when ordering a QuerySet by a reference ↵Simon Charette
containing "__". Regression in b0ad41198b3e333f57351e3fce5a1fb47f23f376. Refs #34013. The initial logic did not consider that annotation aliases can include lookup or transform separators. Thanks Gert Van Gool for the report and Mariusz Felisiak for the review.
2024-08-01Refs #373 -- Added tuple lookups.Bendeguz Csirmaz
2024-08-01Reverted "Fixed #28646 -- Prevented duplicate index when unique is set to ↵Sarah Boyce
True on PostgreSQL." This reverts commit 9cf9c796be8dd53bc3b11355ff39d65c81d7be6d due to a crash on Oracle as it didn't allow multiple indexes on the same field.
2024-07-30Fixed #28646 -- Prevented duplicate index when unique is set to True on ↵Ben Cail
PostgreSQL.
2024-07-25Fixed #35625 -- Fixed a crash when adding a field with db_default and check ↵Simon Charette
constraint. This is the exact same issue as refs #30408 but for creating a model with a constraint containing % escapes instead of column addition. All of these issues stem from a lack of SQL and parameters separation from the BaseConstraint DDL generating methods preventing them from being mixed with other parts of the schema alteration logic that do make use of parametrization on some backends (e.g. Postgres, MySQL for DEFAULT). Prior to the addition of Field.db_default and GeneratedField in 5.0 parametrization of DDL was never exercised on model creation so this is effectively a bug with db_default as the GeneratedField case was addressed by refs #35336. Thanks Julien Chaumont for the report and Mariusz Felisiak for the review.
2024-07-23Fixed #35585 -- Corrected Query.exists() call in Query.has_results().Flavio Curella
2024-07-22Fixed #35614 -- Prevented SQLCompiler.as_subquery_condition() from mutating ↵Bendeguz Csirmaz
a query.
2024-07-22Fixed typos in Atomic docstring.Muhammad N. Fadhil
2024-07-19Fixed #35559 -- Avoided unnecessary query on sliced union of empty queries.Simon Charette
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.
2024-07-18Fixed #35603 -- Prevented F.__contains__() from hanging.Simon Charette
Regression in 94b6f101f7dc363a8e71593570b17527dbb9f77f.