summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2019-05-27Refs #29548 -- Updated docs for MariaDB support.Mariusz Felisiak
2019-05-23Fixed #30501 -- Preventing QuerySet.reverse() from mutating expressions in ↵Mariusz Felisiak
QuerySet.order_by and Meta.ordering.
2019-05-21Fixed #28816 -- Prevented silencing data loss when decreasing ↵Hasan Ramezani
CharField.max_length on PostgreSQL.
2019-05-21Fixed #28147 -- Fixed loss of assigned parent when saving child after parent.Rob
Thanks Erwin Junge for the initial patch.
2019-05-21Refs #29396, #30494 -- Reduced code duplication in year lookups.Simon Charette
2019-05-21Fixed #29396 -- Added indirect values support to __year lookups.Simon Charette
Thanks Windson Yang for the initial patch.
2019-05-21Fixed #30494 -- Disabled __year lookup optimization for indirect values.Simon Charette
The previous heuristics were naively enabling the BETWEEN optimization on successful cast of the first rhs SQL params to an integer while it was not appropriate for a lot of database resolved expressions. Thanks Alexey Chernov for the report.
2019-05-18Fixed #30463 -- Fixed crash of deprecation message when Meta.ordering ↵ruchit2801
contains expressions. Regression in 1b1f64ee5a78cc217fead52cbae23114502cf564.
2019-05-16Fixed #30482 -- Prevented unnecessary evaluation of lookup.queryset in ↵Iain Watts
prefetch_related_objects().
2019-05-13Fixed #30436 -- Added check that on_delete is callable in ForeignKey and ↵Rob
OneToOneField.
2019-05-12Fixed #6785 -- Made QuerySet.get() fetch a limited number of rows.Amir Hadi
Co-authored-by: Tim Graham <timograham@gmail.com> Co-authored-by: Patryk Zawadzki <patrys@room-303.com> Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-05-08Used time.monotonic() instead of time.time() where applicable.Przemysław Suliga
time.monotonic() available from Python 3.3: - Nicely communicates a narrow intent of "get a local system monotonic clock time" instead of possible "get a not necessarily accurate Unix time stamp because it needs to be communicated to outside of this process/machine" when time.time() is used. - Its result isn't affected by the system clock updates. There are two classes of time.time() uses changed to time.monotonic() by this change: - measuring time taken to run some code. - setting and checking a "close_at" threshold for for persistent db connections (django/db/backends/base/base.py).
2019-05-07Fixed #30349 -- Fixed QuerySet.exclude() on FilteredRelation.Rob
Using annotated FilteredRelations raised a FieldError when coupled with exclude(). This is due to not passing filtered relation fields to the subquery created in split_exclude(). We fixed this issue by passing the filtered relation data to the newly created subquery. Secondly, in the case where an INNER JOIN is used in the excluded subquery, the ORM would trim the filtered relation INNER JOIN in attempt to simplify the query. This will also remove the ON clause filters generated by the FilteredRelation. We added logic to not trim the INNER JOIN if it is from FilteredRelation.
2019-05-07Fixed #30444 -- Moved SQL generation for tables to ↵Rob Golding-Day
BaseDatabaseSchemaEditor.table_sql().
2019-05-07Fixed #26678 -- Doc'd that RelatedManager.add()/remove()/set() accepts the ↵Tobias Kunze
field the relation points to.
2019-05-07Readded comment about the default params of cursor.execute().Daniel Hahler
It was removed in in 728548e483a5a3486939b0c8e62520296587482e.
2019-05-06Fixed #30339 -- Made Model.delete(keep_parents=True) preserves nested parent ↵Stephen Brown
reverse relationships. Thanks Simon Charette for the review.
2019-05-03Fixed #29692 -- Fixed removing ordering parts for multiline RawSQL expressions.can
2019-05-02Fixed #29529 -- Allowed models.fields.FilePathField to accept a callable path.Mykola Kokalko
2019-05-01Fixed #30409 -- Allowed using foreign key's attnames in ↵zeyneloz
unique/index_together and Index's fields.
2019-04-30Fixed #30412 -- Fixed crash when adding check constraints with OR'ed ↵can
condition on Oracle and SQLite.
2019-04-30Fixed #30408 -- Fixed crash when adding check constraints with LIKE operator ↵Simon Charette
on Oracle and PostgreSQL. The LIKE operator wildcard generated for contains, startswith, endswith and their case-insensitive variant lookups was conflicting with parameter interpolation on CREATE constraint statement execution. Ideally we'd delegate parameters interpolation in DDL statements on backends that support it but that would require backward incompatible changes to the Index and Constraint SQL generating methods. Thanks David Sanders for the report.
2019-04-29Fixed #30148 -- Logged COPY ... TO statements in connection.queries on ↵kingbuzzman
PostgreSQL.
2019-04-29Refs #30148 -- Moved logging queries in CursorDebugWrapper to debug_sql() ↵kingbuzzman
contextmanager.
2019-04-29Simplified Field.contribute_to_class().Jon Dufresne
2019-04-24Removed unnecessary assignments in various code.Jon Dufresne
2019-04-23Fixed #29810 -- Fixed crash of select_related() on FilteredRelation with ↵can
empty result.
2019-04-21Refs #30380 -- Used cursor._executed in ↵Mariusz Felisiak
DatabaseOperations.last_executed_query() on MySQL. Regression in a41b09266dcdd01036d59d76fe926fe0386aaade. Thanks Tobias Krönke for the report.
2019-04-19Fixed #30380 -- Handled bytes in MySQL backend for PyMySQL support.Mariusz Felisiak
This commit partly reverts efd8a82e268a82b3ad0be77bd5b4548c30bcb4d7.
2019-04-19Fixed #30328 -- Fixed crash of IntegerField.validators when limit_value in a ↵Scott Fitsimones
custom validator is callable.
2019-04-18Fixed #30367 -- Changed "pip install" to "python -m pip install" in docs, ↵Ramiro Morales
comments and hints.
2019-04-18Fixed typos in docs, comments, and exception messages.Ville Skyttä
2019-04-18Fixed #30370 -- Added dbshell support for client TLS certificates on PostgreSQL.Oleh Mykytiuk
2019-04-18Fixed #30335, #29139 -- Fixed crash when ordering or aggregating over a ↵can
nested JSONField key transform.
2019-04-17Fixed #30191 -- Selected only referenced fields during cascade deletion.Simon Charette
The non-referenced fields can only be deferred if no deletion signals receivers are connected for their respective model as connected as these receivers might expect all fields of the deleted model to be present. Thanks Ed Morley for the report.
2019-04-17Refs #18676 -- Enabled fast-delete for m2m_changed senders.Simon Charette
There's no reason to disable fast-delete when an intermediary many-to-many model has connected m2m_changed receivers because the signal is only sent when related manager's clear() and remove() methods are directly called. This must have been overlooked in 1cd6e04cd4f768bcd4385b75de433d497d938f82 given no regression tests fail when m2m_changed is not taken into consideration to determine if fast-delete can be enabled.
2019-04-16Fixed #30368 -- Fixed prefetch_related() for GenericForeignKey when PK is ↵Vinny Do
also a FK.
2019-04-15Refs #23758 -- Used RecursionError instead of RuntimeError to raise nested ↵Simon Charette
subquery errors. RecursionError was introduced in Python 3.5 and subclasses RuntimeError.
2019-04-15Refs #27149 -- Based recursive nested subquery detection on ↵Simon Charette
sys.getrecursionlimit(). This makes sure the test_avoid_infinite_loop_on_too_many_subqueries test doesn't fail on systems with a non-default recursion limit.
2019-04-15Fixed #30325 -- Reverted "Fixed #29725 -- Removed unnecessary join in ↵Mariusz Felisiak
QuerySet.count() and exists() on a many-to-many relation." This reverts commit 1299421cadc4fcf63585f2f88337078e43e660e0 due to a regression with custom managers.
2019-04-14Fixed #30350 -- Prevented recreation of migration for operations with a ↵Florian Apolloner
range object. Thanks to Mariusz Felisiak for helping with the patch.
2019-04-14Fixed #30343 -- Fixed prefetch_related() for GenericForeignKey when PK of ↵Mariusz Felisiak
related field is UUIDField.
2019-04-08Fixed #30266 -- Kept a sequence owner when altering an ↵Dolan Antenucci
AutoField/BigAutoField on PostgreSQL.
2019-04-08Fixed #30330 -- Fixed setting of primary key to None during fast-delete.Florian Apolloner
Regression in bc7dd8490b882b2cefdc7faf431dc64c532b79c9.
2019-04-08Fixed #28373 -- Used connection timezone instead of UTC when making dates ↵can
timezone-aware on MySQL, SQLite, and Oracle. Thanks vtalpaert for the initial patch. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-04-05Refs #20010 -- Unified DatabaseOperations.last_executed_query() on Oracle ↵Mariusz Felisiak
with other db backends. Thanks Simon Charette for the review.
2019-04-05Fixed #30331 -- Added support for psycopg2 2.8.Mariusz Felisiak
2019-04-04Fixed #30307 -- Fixed incorrect quoting of database user password when using ↵msg
dbshell on Oracle. Regression in acfc650f2a6e4a79e80237eabfa923ea3a05d709.
2019-04-03Fixed typo in django/db/models/query_utils.py comment.David Beitey
2019-03-29Removed unnecessary /static from links to PostgreSQL docs.Nick Pope