summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/compiler.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33374 -- Adjusted full match condition handling.Simon Charette2022-11-071-5/+9
| | | | | | Adjusting WhereNode.as_sql() to raise an exception when encoutering a full match just like with empty matches ensures that all case are explicitly handled.
* Refs #28333 -- Added partial support for filtering against window functions.Simon Charette2022-08-151-4/+7
| | | | | | | | | | | | | | | | | | | | Adds support for joint predicates against window annotations through subquery wrapping while maintaining errors for disjointed filter attempts. The "qualify" wording was used to refer to predicates against window annotations as it's the name of a specialized Snowflake extension to SQL that is to window functions what HAVING is to aggregates. While not complete the implementation should cover most of the common use cases for filtering against window functions without requiring the complex subquery pushdown and predicate re-aliasing machinery to deal with disjointed predicates against columns, aggregates, and window functions. A complete disjointed filtering implementation should likely be deferred until proper QUALIFY support lands or the ORM gains a proper subquery pushdown interface.
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-9/+15
|
* Fixed #32645 -- Fixed QuerySet.update() crash when ordered by joined fields ↵Mariusz Felisiak2021-04-141-1/+10
| | | | | | | on MySQL/MariaDB. Thanks Matt Westcott for the report. Regression in 779e615e362108862f1681f965ee9e4f1d0ae6d2.
* Fixed #31965 -- Adjusted multi-table fast-deletion on MySQL/MariaDB.Simon Charette2020-08-311-10/+12
| | | | | | | | | | | | | The optimization introduced in 7acef095d73 did not properly handle deletion involving filters against aggregate annotations. It initially was surfaced by a MariaDB test failure but misattributed to an undocumented change in behavior that resulted in the systemic generation of poorly performing database queries in 5b83bae031. Thanks Anton Plotkin for the report. Refs #23576.
* Fixed #31573 -- Made QuerySet.update() respect ordering on MariaDB/MySQL.davidchorpash2020-07-081-1/+18
|
* Refs #23576 -- Disabled MySQL multi-alias deletion path on MariaDB 10.3.2+.Simon Charette2019-10-311-1/+1
|
* Fixed #23576 -- Implemented multi-alias fast-path deletion in MySQL backend.Simon Charette2019-10-241-1/+19
| | | | | | | | | This required moving the entirety of DELETE SQL generation to the compiler where it should have been in the first place and implementing a specialized compiler on MySQL/MariaDB. The MySQL compiler relies on the "DELETE table FROM table JOIN" syntax for queries spanning over multiple tables.
* Fixed #23867 -- removed DateQuerySet hacksAnssi Kääriäinen2014-11-261-8/+0
| | | | | | The .dates() queries were implemented by using custom Query, QuerySet, and Compiler classes. Instead implement them by using expressions and database converters APIs.
* Fixed #23889 -- Added more usage of quote_name_unless_alias() to avoid ↵Collin Anderson2014-11-211-1/+2
| | | | deprecation warnings.
* Fixed #18757, #14462, #21565 -- Reworked database-python type conversionsMarc Tamlyn2014-09-031-11/+0
| | | | | | | | | | | | Complete rework of translating data values from database Deprecation of SubfieldBase, removal of resolve_columns and convert_values in favour of a more general converter based approach and public API Field.from_db_value(). Now works seamlessly with aggregation, .values() and raw queries. Thanks to akaariai in particular for extensive advice and inspiration, also to shaib, manfre and timograham for their reviews.
* Fixed E125 pep8 warningsChristopher Medrela2013-11-281-1/+1
|
* Used six.moves.zip_longest, new in six 1.4.0.Aymeric Augustin2013-09-021-5/+1
|
* Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette2013-08-301-1/+1
|
* A large number of stylistic cleanups across django/db/Alex Gaynor2013-07-081-0/+6
|
* Fixed #20507 -- SubqueryConstraint alias handlingAnssi Kääriäinen2013-05-271-2/+1
| | | | MySQL should work now, too.
* Fixed #19385 again, now with real code changesAnssi Kääriäinen2013-03-241-0/+6
| | | | | The commit of 266de5f9ae9e9f2fbfaec3b7e4b5fb9941967801 included only tests, this time also code changes included...
* Fixed #17260 -- Added time zone aware aggregation and lookups.Aymeric Augustin2013-02-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks Carl Meyer for the review. Squashed commit of the following: commit 4f290bdb60b7d8534abf4ca901bd0844612dcbda Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 13 21:21:30 2013 +0100 Used '0:00' instead of 'UTC' which doesn't always exist in Oracle. Thanks Ian Kelly for the suggestion. commit 01b6366f3ce67d57a58ca8f25e5be77911748638 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 13 13:38:43 2013 +0100 Made tzname a parameter of datetime_extract/trunc_sql. This is required to work around a bug in Oracle. commit 924a144ef8a80ba4daeeafbe9efaa826566e9d02 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Wed Feb 13 14:47:44 2013 +0100 Added support for parameters in SELECT clauses. commit b4351d2890cd1090d3ff2d203fe148937324c935 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 22:30:22 2013 +0100 Documented backwards incompatibilities in the two previous commits. commit 91ef84713c81bd455f559dacf790e586d08cacb9 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 09:42:31 2013 +0100 Used QuerySet.datetimes for the admin's date_hierarchy. commit 0d0de288a5210fa106cd4350961eb2006535cc5c Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 09:29:38 2013 +0100 Used QuerySet.datetimes in date-based generic views. commit 9c0859ff7c0b00734afe7fc15609d43d83215072 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:43:25 2013 +0100 Implemented QuerySet.datetimes on Oracle. commit 68ab511a4ffbd2b811bf5da174d47e4dd90f28fc Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:43:14 2013 +0100 Implemented QuerySet.datetimes on MySQL. commit 22d52681d347a8cdf568dc31ed032cbc61d049ef Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:42:29 2013 +0100 Implemented QuerySet.datetimes on SQLite. commit f6800fd04c93722b45f9236976389e0b2fe436f5 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:43:03 2013 +0100 Implemented QuerySet.datetimes on PostgreSQL. commit 0c829c23f4cf4d6804cadcc93032dd4c26b8c65e Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:41:08 2013 +0100 Added datetime-handling infrastructure in the ORM layers. commit 104d82a7778cf3f0f5d03dfa53709c26df45daad Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Mon Feb 11 10:05:55 2013 +0100 Updated null_queries tests to avoid clashing with the __second lookup. commit c01bbb32358201b3ac8cb4291ef87b7612a2b8e6 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 23:07:41 2013 +0100 Updated tests of .dates(). Replaced .dates() by .datetimes() for DateTimeFields. Replaced dates with datetimes in the expected output for DateFields. commit 50fb7a52462fecf0127b38e7f3df322aeb287c43 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 21:40:09 2013 +0100 Updated and added tests for QuerySet.datetimes. commit a8451a5004c437190e264667b1e6fb8acc3c1eeb Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 22:34:46 2013 +0100 Documented the new time lookups and updated the date lookups. commit 29413eab2bd1d5e004598900c0dadc0521bbf4d3 Author: Aymeric Augustin <aymeric.augustin@m4x.org> Date: Sun Feb 10 16:15:49 2013 +0100 Documented QuerySet.datetimes and updated QuerySet.dates.
* [py3] Prepared MySQL backend for Python 3 compatibilityClaude Paroz2012-08-201-1/+7
|
* [py3] Removed unnecessary calls to .keys()Aymeric Augustin2012-08-141-1/+1
| | | | when computing the length of a dictionary. This fails on Python 3.
* Fixed #17796 -- Rolled back [17588] because the fix for the original relativelyRamiro Morales2012-02-291-1/+4
| | | | | | | | | | | corner case (boolean fields under MySQL spatial backend) had a wider scope with potentially unintended consequences affecting the main MySQL backend and the required changes wouldn't be appropiate at this point of the 1.4 development cycle. Refs #15169. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15169 -- Corrected handling of model boolean fields in MySQL spatial ↵Ramiro Morales2012-02-261-4/+1
| | | | | | | | | | backend. Thanks goes to zmsmith and others for reporting the issue and to Justin Bronn for the fix. Refs #7190, r12578, r12900, #13293, r12939. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #13293 -- Corrected a problem with the MySQL handling of boolean ↵Russell Keith-Magee2010-04-091-3/+3
| | | | | | return values when a query has an extra() clause. Thanks to mk for the report and draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7190 -- Corrected a problem with Boolean value handling on the MySQL ↵Russell Keith-Magee2010-04-011-0/+27
backend. Thanks to George Vilches for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12900 bcc190cf-cafb-0310-a4f2-bffc1f526a37