summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
AgeCommit message (Collapse)Author
2017-04-07Fixed #23147 -- Disabled a limit/offset on a query with select_for_update on ↵Mariusz Felisiak
Oracle. Thanks Shai Berger and Tim Graham for the reviews.
2017-03-29Fixed #25414 -- Fixed QuerySet.annotate() with pk in values() on MySQL.Mariusz Felisiak
Thanks Tim Graham and Simon Charette for the reviews.
2017-02-28Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-25Removed unused variables that are overwritten.Mads Jensen
2017-01-21Refs #23919 -- Removed misc references to Python 2.Tim Graham
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-14Fixed #27718 -- Added QuerySet.union(), intersection(), difference().Florian Apolloner
Thanks Mariusz Felisiak for review and Oracle assistance. Thanks Tim Graham for review and writing docs.
2017-01-14Refs #16614 -- Prevented database errors from being masked by cursor close.François Freitag
When an error occurred during the cursor.execute statement, the cursor is closed. This operation did not fail with client-side cursors. Now, with server-side cursors, the close operation might fail (example below). The original error should be raised, not the one raised by cursor.close(), this is only clean-up code. For example, one can attempt to create a named cursor for an invalid query. psycopg will raise an error about the invalid query and the server-side cursor will not be created on PostgreSQL. When the code attempts to cursor.close(), it asks psycopg to close a cursor that was not created. pyscopg raises a new error: psycopg2.OperationalError: cursor "_django_curs_140365867840512_20" does not exist.
2017-01-11Refs #16614 -- Made QuerySet.iterator() use server-side cursors on PostgreSQL.François Freitag
Thanks to Josh Smeaton for the idea of implementing server-side cursors in PostgreSQL from the iterator method, and Anssi Kääriäinen and Kevin Turner for their previous work. Also Simon Charette and Tim Graham for review.
2016-12-29Removed unused enumerate.Florian Apolloner
2016-12-14Fixed #27594 -- Fixed select_related() with reverse self-referential ↵Daniel Hillier
OneToOneField. Fixed definition of `klass_info['from_parent']` so that two models aren't considered from a parent class if the model classes are the same.
2016-10-28Fixed #20939 -- Simplified query generation by converting QuerySet to Query.Tim Graham
Thanks Anssi Kääriäinen for the initial patch and Anssi, Simon Charette, and Josh Smeaton for review.
2016-10-13Removed unused branch in SQLUpdateCompiler.as_sql().Tim Graham
Unknown if it was ever needed.
2016-10-13Removed unused EmptyResultSets in SQLCompilers.Tim Graham
Unused since ed1bcf05158acf4bf4e0189d477b6c762bd0133e.
2016-10-04Fixed #27193 -- Preserved ordering in select_for_update subqueries.François Freitag
2016-09-27Removed unused branch in SQLCompiler.as_subquery_condition().Tim Graham
Unused since dcdc579d162b750ee3449e34efd772703592faca.
2016-09-09Fixed #27062 -- Eased implementing select_for_update() on MSSQL.Mikhail Denisenko
2016-08-08Fixed #26500 -- Added SKIP LOCKED support to select_for_update().Simon Charette
Thanks Tim for the review.
2016-08-08Moved EmpytResultSet to django.core.exceptions.Johannes Dollinger
This removes the need for some inner imports.
2016-08-08Fixed #26517 -- Fixed ExpressionWrapper with empty queryset.Johannes Dollinger
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-03-05Refs #19527 -- Fixed SQL compiler regression causing Oracle failure.Tim Graham
2016-03-02Refs #19527 -- Allowed QuerySet.bulk_create() to set the primary key of its ↵acrefoot
objects. PostgreSQL support only. Thanks Vladislav Manchev and alesasnouski for working on the patch.
2016-01-20Fixed #26092 -- Fixed QuerySet.order_by() regression with an M2M through model.Anssi Kääriäinen
2015-12-17Refs #25894 -- Fixed evaluation of zero-length slices of QuerySet.values() ↵Sergey Fedoseev
on Oracle.
2015-12-15Fixed #25894 -- Fixed evaluation of zero-length slices of QuerySet.values().Sergey Fedoseev
2015-11-17Simplified lists creation in three places.Dmitry Dygalo
2015-10-10Fixed #24687 -- Added select_related() validation for nested non-relational ↵Tim Graham
fields. The removed test was added in the original select_related() validation patch (45d4e43d2d25b902e3821b612209afa951a8bcb8), but there doesn't seem to be any reason for it. Thanks Claude Paroz for help and review.
2015-09-23Removed SQLCompiler.__call__() per deprecation timeline.Tim Graham
2015-09-22Fixed #24509 -- Added Expression support to SQLInsertCompilerAlex Hill
2015-09-04Fixed #19263 -- Fixed crash when filtering using __in and an empty QuerySet.Tim Graham
Thanks Marcin Biernat for the initial patch and tests.
2015-08-20Fixed #24951 -- Fixed AssertionError in delete queries involving a ↵Tim Graham
foreign/primary key. Thanks Anssi Kääriäinen for help.
2015-08-15Fixed #24986 -- Added support for annotations in DISTINCT queries.Valentina Mukhamedzhanova
2015-07-28Adjusted SQLCompiler.get_order_by()'s docstring return value.risicle
2015-06-24Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham
Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
2015-05-11Fixed #24748 -- Fixed incorrect GROUP BY on MySQL in some queriesAnssi Kääriäinen
When the query's model had a self-referential foreign key, the compiler.get_group_by() code incorrectly used the self-referential foreign key's column (for example parent_id) as GROUP BY clause when it should have used the model's primary key column (id).
2015-04-20Fixed #24654 -- Based ordering circular references detection on columns.Simon Charette
Thanks to Elmar Bucher for the report and Tim for the review.
2015-04-16Fixed #24605 -- Fixed incorrect reference to alias in subquery.Anssi Kääriäinen
Thanks to charettes and priidukull for investigating the issue, and to kurevin for the report.
2015-04-16Fixed #24615 -- ordering by expression not part of SELECTAnssi Kääriäinen
Fixed queries where an expression was used in order_by() but the expression wasn't in the query's select clause (for example the expression could be masked by .values() call) Thanks to Trac alias MattBlack85 for the report.
2015-04-13Fixed #24611 -- Fixed update() crash with related UUID pk object.Jay Wineinger
2015-03-29Fixed #19259 -- Added group by selected primary keys support.Simon Charette
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2015-03-25Removed field.field check in setup_joins()Anssi Kääriäinen
2015-02-20Update converters to take a consistent set of parameters.Marc Tamlyn
As suggested by Anssi. This has the slightly strange side effect of passing the expression to Expression.convert_value has the expression passed back to it, but it allows more complex patterns of expressions.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-04Fixed #24268 -- removed Query.havingAnssi Kääriäinen
Instead of splitting filter clauses to where and having parts before adding them to query.where or query.having, add all filter clauses to query.where, and when compiling the query split the where to having and where parts.
2015-01-30Fixed #14483 -- Allowed using subqueries with GIS lookupsClaude Paroz
2015-01-30Fixed #24164 -- Fixed Oracle GIS limited aggregation test failure.Tim Graham