Commit Graph

1652 Commits

Author SHA1 Message Date
Hasan Ramezani e3d0b4d550 Fixed #30899 -- Lazily compiled import time regular expressions. 2019-10-29 09:22:26 +01:00
Nick Pope 55df1750be Refs #30897 -- Added support for ANALYZE option to Queryset.explain() on MariaDB and MySQL 8.0.18+. 2019-10-24 15:13:26 +02:00
Nick Pope 742961332e Refs #30897 -- Added support for TREE format to Queryset.explain() on MySQL 8.0.16+. 2019-10-24 15:13:23 +02:00
Simon Charette 7acef095d7 Fixed #23576 -- Implemented multi-alias fast-path deletion in MySQL backend.
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.
2019-10-24 12:24:53 +02:00
Mariusz Felisiak e645f27907
Fixed DatabaseFeatures.update_can_self_select on MariaDB 10.3.2+. 2019-10-24 12:18:13 +02:00
Hannes Ljungberg fa5f3291e7 Fixed #30903 -- Fixed migrations crash on PostgreSQL when adding Index with opclasses and ordering. 2019-10-24 09:33:14 +02:00
Nick Pope 6e9189c080 Refs #30897 -- Added test for SETTINGS option to Queryset.explain() on PostgreSQL 12+. 2019-10-23 14:07:18 +02:00
Hasan Ramezani ef4beafa2c Refs #28816 -- Prevented silencing data loss when decreasing CharField.max_length for ArrayField.base_field on PostgreSQL. 2019-10-17 12:50:53 +02:00
Mariusz Felisiak 187a64608d Fixed #30885 -- Dropped support for MariaDB 10.1. 2019-10-16 18:40:48 +02:00
Mariusz Felisiak 4a849b6701
Fixed #30859 -- Fixed DatabaseFeatures.supports_aggregate_filter_clause on SQLite 3.30.1+. 2019-10-15 20:55:49 +02:00
Mariusz Felisiak 02c63b8f2f
Refs #26608 -- Fixed DatabaseFeatures.supports_frame_range_fixed_distance on SQLite 3.28+, MariaDB 10.2+, and MySQL 8.0.2+. 2019-10-09 13:07:50 +02:00
Anatol Ulrich 8ed6788aa4 Fixed #30821 -- Added ExtractIsoWeekYear database function and iso_week_day lookup. 2019-10-02 10:41:34 +02:00
Mariusz Felisiak 67e7dffe95 Fixed typo in BulkInsertMapper constant name. 2019-10-01 14:46:10 +02:00
Ahmet Kucuk dc890bef5a Fixed #30510 -- Fixed crash of QuerySet.bulk_create() with mixed-length texts on Oracle.
Text with more than 4000 characters must be set to as a CLOB on Oracle
what caused a mixed datatype error (ORA-01790) when shorter text
appeared in the same operation.
2019-10-01 12:38:58 +02:00
Mariusz Felisiak 580e644f24
Fixed #30800 -- Fixed migrations crash when altering a field with custom db_type().
Regression in 1378d665a1.
2019-09-25 12:32:24 +02:00
Mariusz Felisiak 01104368ff Refs #29444 -- Removed redundant DatabaseFeatures.can_return_multiple_columns_from_insert.
Unnecessary since b31e63879e.
2019-09-24 10:37:22 +02:00
Johannes Hoppe b31e63879e Fixed #29444 -- Allowed returning multiple fields from INSERT statements on Oracle. 2019-09-24 10:22:43 +02:00
Andrew 3346b78a8a Fixed #30786 -- Used CONVERT_TZ to check if the time zone definitions are installed on MySQL.
Replaced a timezone check in the MySQL backend with one that doesn't
require access to the mysql.time_zone database.
2019-09-20 08:17:27 +02:00
Adnan Umer 241deed259 Fixed #30591 -- Fixed recreation of foreign key constraints on MySQL when altering type of referenced unique field.
Thanks Mariusz Felisiak for tests and Matthijs Kooijman for
investigation and initial patch.
2019-09-11 11:21:08 +02:00
Vojtech Bocek b1d37fea8f Fixed #28107 -- Added DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models. 2019-09-09 14:04:46 +02:00
Johannes Hoppe 7254f1138d Refs #29444 -- Allowed returning multiple fields from INSERT statements on PostgreSQL.
Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and
Mariusz Felisiak for reviews.
2019-09-09 10:51:14 +02:00
Johannes Hoppe 736e7d44de Refs #29444 -- Fixed DateField constructor in db.backends.oracle.utils.InsertVar. 2019-09-09 10:51:07 +02:00
Mariusz Felisiak addabc492b
Fixed DatabaseFeatures.can_introspect_check_constraints on MariaDB < 10.2.22, 10.3.0 - 10.3.9.
Regression in e2c6a0858d.
2019-09-06 11:53:54 +02:00
Mariusz Felisiak e2c6a0858d Fixed #30750 -- Added support for check constraints on MySQL 8.0.16+. 2019-09-05 09:18:34 +02:00
Johannes Hoppe 003bb34b21 Refs #29444 -- Made db.backends.oracle.utils.InsertVar use str as default. 2019-09-03 10:34:55 +02:00
Matthew Schinckel 4137fc2efc Fixed #25367 -- Allowed boolean expressions in QuerySet.filter() and exclude().
This allows using expressions that have an output_field that is a
BooleanField to be used directly in a queryset filters, or in the
When() clauses of a Case() expression.

Thanks Josh Smeaton, Tim Graham, Simon Charette, Mariusz Felisiak, and
Adam Johnson for reviews.

Co-Authored-By: NyanKiyoshi <hello@vanille.bid>
2019-08-29 09:45:29 +02:00
Mariusz Felisiak 579909a13f
Refs #30591 -- Fixed introspection of check and unique column constraints on MariaDB.
Unnamed unique and check columns constraints have the same name as
a column. Ensure uniqueness by using custom names.

Thanks Adnan Umer for the report.
2019-08-26 09:15:37 +02:00
Claude Paroz 9386586f31 Replaced subprocess commands by run() wherever possible. 2019-08-23 10:53:36 +02:00
Nasir Hussain 6b16c91157 Fixed #30712 -- Allowed BLOB/TEXT defaults on MySQL 8.0.13+. 2019-08-22 12:23:10 +02:00
Mads Jensen 85ac838d9e Fixed #21039 -- Added AddIndexConcurrently/RemoveIndexConcurrently operations for PostgreSQL.
Thanks to Simon Charettes for review.

Co-Authored-By: Daniel Tao <daniel.tao@gmail.com>
2019-08-21 13:10:06 +02:00
Nick Pope 21e559495b Fixed #29979, Refs #17337 -- Extracted AutoField field logic into a mixin and refactored AutoFields.
This reduces duplication by allowing AutoField, BigAutoField and
SmallAutoField to inherit from IntegerField, BigIntegerField and
SmallIntegerField respectively. Doing so also allows for enabling the
max_length warning check and minimum/maximum value validation for auto
fields, as well as providing a mixin that can be used for other possible
future auto field types such as a theoretical UUIDAutoField.
2019-08-20 09:22:25 +02:00
Adam Johnson 7da6a28a44 Fixed #27676 -- Allowed BLOB/TEXT defaults on MariaDB 10.2.1+. 2019-08-16 11:39:37 +02:00
Simon Charette efa1908f66 Refs #25367 -- Moved Oracle Exists() handling to contextual methods.
Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in
the following cases.

1. When part of a SELECT clause.
2. When part of a ORDER BY clause.
3. When compared against another expression in the WHERE clause.

This commit moves the systematic CASE WHEN wrapping of Exists.as_oracle
to contextual .select_format, Lookup.as_oracle, and OrderBy.as_oracle
methods in order to avoid unnecessary wrapping.
2019-08-13 06:48:14 +02:00
Simon Charette 2fb872e56f Refs #23879 -- Made introspection respect required_db_features. 2019-08-12 06:33:46 +02:00
Nick Pope 194d1dfc18 Fixed #30661 -- Added models.SmallAutoField. 2019-08-02 11:39:01 +02:00
Mariusz Felisiak d14fa04ab3 Removed obsolete mentions of a check constraint in BaseDatabaseSchemaEditor.add_constraint()/remove_constraint() docstrings. 2019-08-02 07:09:37 +02:00
Mariusz Felisiak ff111ea5e3 Refs #30664 -- Fixed migrations crash when altering AutoField/BigAutoField with quoted db_column on PostgreSQL. 2019-08-01 12:06:32 +02:00
Ngalim Siregar e4684220af Fixed #30664 -- Fixed migrations crash when altering table on SQLite or altering AutoField/BigAutoField on PostgreSQL for models with quoted db_table. 2019-08-01 12:06:32 +02:00
Hasan Ramezani e3fc9af4ab Refs #30593 -- Fixed introspection of check constraints columns on MariaDB. 2019-07-30 16:32:13 +02:00
Hasan Ramezani b2aad9ad4d Refs #30593 -- Added _parse_constraint_columns() hook to introspection on MariaDB. 2019-07-30 16:32:13 +02:00
Mariusz Felisiak 8d52a525c8
Refs #29548 -- Fixed DatabaseWrapper.display_name on MariaDB. 2019-07-23 13:34:06 +02:00
Georgi Yanchev c6581a40be Fixed #30644 -- Made introspection use pg_table_is_visible() instead of filtering by public schema on PostgreSQL. 2019-07-22 08:14:53 +02:00
Mariusz Felisiak 842fd620ff
Simplified get_key_columns()/get_relations() introspection methods for PostgreSQL. 2019-07-20 15:15:41 +02:00
Hasan Ramezani 1fc2c70f76 Fixed #30593 -- Added support for check constraints on MariaDB 10.2+. 2019-07-19 11:05:06 +02:00
Yann Sionneau e47b8293a7 Fixed #30636 -- Fixed options ordering when cloning test database on MySQL.
--defaults-file must be given before other options.
2019-07-16 07:25:43 +02:00
Johannes Hoppe bc91f27a86 Refs #29444 -- Added support for fetching a returned non-integer insert values on Oracle.
This is currently not actively used, since the ORM will ask the
SQL compiler to only return auto fields.
2019-07-08 08:53:08 +02:00
Min ho Kim fbb83fefd4 Fixed typos in comments and docs. 2019-07-02 09:36:17 +02:00
Andrew Godwin a415ce70be Fixed #30451 -- Added ASGI handler and coroutine-safety.
This adds an ASGI handler, asgi.py file for the default project layout,
a few async utilities and adds async-safety to many parts of Django.
2019-06-20 12:29:43 +02:00
can fde9b7d35e Fixed #30128 -- Fixed handling timedelta timezone in database functions. 2019-06-13 09:29:43 +02:00
Mariusz Felisiak b6c4766f53
Refs #29548 -- Updated docs for MariaDB support. 2019-05-27 19:59:49 +02:00