Commit Graph

1359 Commits

Author SHA1 Message Date
Mariusz Felisiak 8149bd00d8 Fixed #28258 -- Optimized Oracle introspection by using LISTAGG.
Thanks Tim Graham and Jani Tiainen for reviews.
2017-06-02 16:54:34 +02:00
Jon Dufresne 2c69824e5a Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
Mariusz Felisiak 9af6c97504 Refs #26682 -- Added AutoField introspection on Oracle. 2017-06-01 19:33:48 +02:00
Mariusz Felisiak 924a89e135 Fixed #26682 -- Added support for Oracle identity columns.
Thanks Shai Berger and Tim Graham for reviews.
2017-06-01 19:33:48 +02:00
Jon Dufresne 21046e7773 Fixed #28249 -- Removed unnecessary dict.keys() calls.
iter(dict) is equivalent to iter(dict.keys()).
2017-05-27 19:08:46 -04:00
Mariusz Felisiak 91b2bc3e70 Fixed #27860 -- Dropped varchar_pattern_ops/text_pattern_ops index before altering char/text field in PostgreSQL.
Thanks Tim Graham for the review.
2017-05-24 07:25:59 +02:00
Mariusz Felisiak 538bf43458 Fixed #27859 -- Ignored db_index for TextField/BinaryField on Oracle and MySQL.
Thanks Zubair Alam for the initial patch and Tim Graham for the review.
2017-05-23 17:02:40 +02:00
Mariusz Felisiak b3eb6eaf1a Refs #27859 -- Added DatabaseWrapper.display_name.
Thanks Tim Graham for the review.
2017-05-23 09:09:35 -04:00
Tim Schneider 3a5299c19c Fixed #28197 -- Fixed introspection of index field ordering on PostgreSQL. 2017-05-15 08:33:31 -04:00
Mariusz Felisiak 5cff2cb4c0 Refs #27859 -- Refactored BaseDatabaseValidation to use check_field_type().
Thanks Tim Graham for the review.
2017-05-14 18:34:45 +02:00
Florian Apolloner 837259a63f Pass type to sql_alter_column_* where it was missing.
This is a followup to 2b3a941457
2017-05-09 12:47:35 +02:00
Tim Graham 05098fa449 Fixed typo in django/db/backends/base/schema.py comment. 2017-05-01 20:45:33 -04:00
Markus Holtermann 663e48947f Fixed #28052 -- Prevented dropping Meta.indexes when changing db_index to False.
Thanks Marc Tamlyn for the report and Ian Foote/Tim Graham for review.
2017-05-01 11:31:48 -04:00
Mariusz Felisiak 946775227c Fixed #28138 -- Used ​output type handler instead of numbersAsStrings on Oracle ​cursor.
Thanks Tim Graham for the review.
2017-04-28 16:27:21 +02:00
Tim Graham 8095496a1c Fixed force_text() import in Oracle backend. 2017-04-27 08:47:33 -04:00
Claude Paroz 301de774c2 Refs #27795 -- Replaced many force_text() with str()
Thanks Tim Graham for the review.
2017-04-27 09:10:02 +02:00
Mariusz Felisiak e776dd2db6 Fixed #28116 -- Used error code filtering in PostgreSQL test database creation.
Thanks Claude Paroz and Tim Graham for reviews.
2017-04-25 06:01:25 +02:00
Mariusz Felisiak 87f9a3c5b2 Updated Oracle docs links to Oracle 12c. 2017-04-21 16:02:31 +02:00
Mariusz Felisiak 63b36d6419 Removed unused DatabaseIntrospection._name_to_index() from Oracle backend.
Unused since its introduction in cac7675f24.
2017-04-18 14:17:08 +02:00
Mariusz Felisiak e5dce7b0fb Refs #27795 -- Removed unneeded force_text calls from the Oracle backend. 2017-04-17 14:22:00 +02:00
Mariusz Felisiak e1253bc26f Refs #25406 -- Removed exception hiding in MySQL test database creation during --keepdb.
Thanks Adam Johnson, Simon Charette and Tim Graham for reviews.
2017-04-13 20:20:01 +02:00
Sergey Fedoseev e7afef13f5 Fixed #26788 -- Fixed QuerySet.update() crash when updating a geometry to another one. 2017-04-10 13:26:26 -04:00
Mariusz Felisiak 64264c9a19 Fixed #25406 -- Removed exception hiding in PostgreSQL test database creation during --keepdb.
Thanks Markus Holtermann and Tim Graham for reviews.
2017-04-10 13:04:00 -04:00
Mariusz Felisiak 054a44d6f0 Used NotSupportedError instead of DatabaseError in SQLCompiler.as_sql(). 2017-04-10 12:49:27 -04:00
Simon Charette a354c69055 Fixed #28038 -- Restored casting to text of builtin lookups on PostgreSQL.
Reverted 658f1e8 which broke code using __icontains's implicit cast to ::text
on ArrayField.

Thanks Peter J. Farrell for the report.
2017-04-07 16:47:52 -04:00
Mariusz Felisiak 695d4dd790 Fixed #23147 -- Disabled a limit/offset on a query with select_for_update on Oracle.
Thanks Shai Berger and Tim Graham for the reviews.
2017-04-07 14:08:07 +02:00
Simon Charette 35c0025151 Fixed #27928 -- Avoided SET/DROP DEFAULT unless a field changes from null to non-null.
Thanks Christophe Pettus, Matteo Pietro Russo for reports and Tim for review.
2017-04-02 16:34:03 -04:00
Chris Sinchok 66150f7cf6 Fixed #27954 -- Allowed keyboard interrupt to abort queries in PostgreSQL dbshell.
Thanks Tim Martin for review.
2017-04-01 21:01:08 -04:00
Tim Graham eca6f91be2 Updated cx_Oracle arraysize comment. 2017-03-28 09:41:45 -04:00
Mariusz Felisiak f42c7cc87b Refs #21160 -- Replaced DatabaseFeatures.supports_1000_query_parameters by a DatabaseFeatures.max_query_params. 2017-03-24 18:37:03 +01:00
Mariusz Felisiak 43380e9110 Fixed #27966 -- Bumped required psycopg2 version to 2.5.4.
Thanks Tim Graham for the review.
2017-03-21 17:23:17 +01:00
Mariusz Felisiak 75503a823f Fixed #27924 -- Added support for cx_Oracle 5.3.
- Fixed Oracle backend due to cx_Oracle 5.3 change in the
Cursor.description behavior i.e. "Use None instead of 0 for items in
the Cursor.description attribute that do not have any validity.".
- Used cx_Oracle.Object.size() instead of len().
Thanks Tim Graham for the review.
2017-03-10 23:02:44 +01:00
Mariusz Felisiak 94d8bea212 Fixed #24365 -- Made inspectdb translate MySQL unsigned integer columns to positive integer fields. 2017-03-08 10:56:00 -05:00
Claude Paroz 8346680e1c Refs #27795 -- Removed unneeded force_text calls
Thanks Tim Graham for the review.
2017-03-04 18:18:21 +01:00
Mariusz Felisiak 6b47431aaf Refs #27860 -- Simplified deleting indexes on PostgreSQL using "IF EXISTS". 2017-03-03 10:50:34 -05:00
Tim Graham 29ea9714ee Removed PostgreSQL version detection for psycopg2 < 2.0.12. 2017-03-01 13:17:34 -05:00
Anton Samarchyan 60e52a047e Refs #27656 -- Updated django.db docstring verbs according to PEP 257. 2017-02-28 09:17:27 -05:00
Tim Graham 6b00af5014 Refs #27802 -- Corrected BaseDatabaseOperations.datetime_extract/trunc_sql() docstrings. 2017-02-27 10:07:24 -05:00
Tim Graham 82026d61a3 Refs #27843 -- Fixed 'invalid escape sequence' warning in truncate_name(). 2017-02-27 09:28:02 -05:00
Vytis Banaitis 3dcc351691 Refs #23919 -- Used yield from. 2017-02-23 20:06:01 -05:00
Tim Graham 0a0c24581e Refs #26285 -- Removed postgresql's unused DatabaseOperations.fulltext_search_sql().
Should have been removed in 5139832398.
2017-02-21 13:10:24 -05:00
Vytis Banaitis 4045fd56cb Fixed #27856 -- Improved accuracy of date subtraction on PostgreSQL.
Accuracy was incorrect when dates differ by a month or more.
2017-02-21 12:06:16 -05:00
Mariusz Felisiak b935190572 Fixed #27843 -- Fixed truncate_name() when the name contains a username. 2017-02-17 09:24:55 -05:00
Tim Graham b008f7cc56 Fixed #27135 -- Made index introspection return Index.suffix. 2017-02-15 20:15:02 -05:00
Mikhail Nacharov c4e2fc5d98 Fixed #22669 -- Fixed QuerySet.bulk_create() with empty model fields on Oracle. 2017-02-09 18:47:08 -05:00
Mariusz Felisiak 965f678a39 Fixed #25898 -- Made test database/user creation on Oracle reraise unexpected errors.
Thanks Shai Berger and Tim Graham for review.
2017-02-09 17:55:07 -05:00
Tim Graham 500532c95d Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode(). 2017-02-09 09:03:47 -05:00
Mariusz Felisiak 1b96dbdad0 Fixed #27822 -- Replaced deprecated cx_Oracle types in DatabaseIntrospection.data_types_reverse. 2017-02-09 08:57:34 -05:00
Mariusz Felisiak 15c14f6f16 Fixed #27802 -- Unified return value of db backend datetime SQL methods. 2017-02-06 09:19:13 -05:00
Tim Graham 924af638e4 Fixed #27683 -- Made MySQL default to the read committed isolation level.
Thanks Shai Berger for test help and Adam Johnson for review.
2017-02-01 15:34:17 -05:00
Vytis Banaitis 8838d4dd49 Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments. 2017-02-01 11:41:56 -05:00
Claude Paroz 52138b1fd0 Refs #23919 -- Removed usage of obsolete SafeBytes class
The class will be removed as part of #27753.
Thanks Tim Graham for the review.
2017-01-30 15:04:45 +01:00
Mariusz Felisiak 89501d9298 Fixed #27789 -- Simplified query for sequence value on Oracle. 2017-01-30 08:03:42 -05:00
Tim Graham 0de0699d94 Fixed #27788 -- Dropped support for Oracle < 12.1. 2017-01-28 08:19:47 -05:00
Vytis Banaitis d1bab24e01 Refs #23919, #27778 -- Removed obsolete mentions of unicode. 2017-01-26 08:19:27 -05:00
Tim Graham 1c466994d9 Refs #23919 -- Removed misc Python 2/3 references. 2017-01-25 13:59:25 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Tim Graham 2d96c027f5 Refs #23919 -- Removed obsolete MySQLdb references. 2017-01-25 10:16:10 -05:00
Tim Graham 3f0c4fe18f Refs #25175 -- Deprecated db.backends.postgresql_psycopg2 module. 2017-01-25 09:23:04 -05:00
Mads Jensen ebf34c3cdc Removed unused variables that are overwritten. 2017-01-25 09:14:05 -05:00
Tim Graham 5b95d421f7 Refs #23919 -- Removed a MySQLdb workaround (refs #6052) for Python 2. 2017-01-24 08:35:06 -05:00
Tim Graham 248d54569e Removed MySQL decimal casting.
Added in Django 1.0: 92c35a0617
Unknown when it became obsolete.
2017-01-23 10:44:02 -05:00
Claude Paroz 6e55e1d88a Refs #23919 -- Replaced six.reraise by raise 2017-01-22 20:08:04 +01:00
Tim Graham d170c63351 Refs #23919 -- Removed misc references to Python 2. 2017-01-21 20:02:00 -05:00
Tim Graham 1b06d5e6f6 Refs #23919 -- Removed pysqlite support (it's Python 2 only). 2017-01-20 18:21:15 -05:00
Claude Paroz 042b7350a0 Refs #23919 -- Removed unneeded str() calls 2017-01-20 14:13:55 +01:00
Claude Paroz dc8834cad4 Refs #23919 -- Removed unneeded force_str calls 2017-01-20 08:44:31 +01:00
Mariusz Felisiak bf1c957027 Refs #23919 -- Removed Python 2 workaround for hashing Oracle params (refs #27632). 2017-01-19 22:20:14 -05:00
james mike dupont 7d20094996 Fixed spelling mistakes in code and comments. 2017-01-19 07:52:41 -05:00
Simon Charette cecc079168 Refs #23919 -- Stopped inheriting from object to define new style classes. 2017-01-19 08:39:46 +01:00
Claude Paroz 2b281cc35e Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
2017-01-18 21:33:28 +01:00
Claude Paroz 7b2f2e74ad Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Claude Paroz c716fe8782 Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
2017-01-18 16:21:28 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Tim Graham 5139832398 Refs #26285 -- Removed MySQL __search lookup per deprecation timeline. 2017-01-17 20:52:03 -05:00
Tim Graham bcf3532ede Refs #26154 -- Removed deprecated CommaSeparatedIntegerField. 2017-01-17 20:52:02 -05:00
Tim Graham e707e4c709 Refs #19738 -- Removed timezone conversion in SQL queries executed outside of the ORM.
Per deprecation timeline.
2017-01-17 14:09:29 -05:00
Tim Graham a3bd8672d8 Refs #24154 -- Removed deprecated BaseDatabaseOperations.check_aggregate_support(). 2017-01-17 14:09:28 -05:00
Tim Graham f01ad1cb6a Refs #27683 -- Allowed setting isolation level in DATABASES ['OPTIONS'] on MySQL. 2017-01-17 11:16:15 -05:00
Mariusz Felisiak 7d2db2a7b8 Refs #27690 -- Removed sleep before drop test db on Oracle. 2017-01-16 19:20:28 -05:00
Tim Graham b5511dddd6 Moved unneeded ImproperlyConfigured inner imports. 2017-01-16 12:48:41 -05:00
François Freitag 05bdf4f44d Refs #16614 -- Called _prepare_cursor() on every created cursor. 2017-01-16 09:12:23 -05:00
Mads Jensen e585c43be9 Fixed #25809 -- Added BrinIndex support in django.contrib.postgres.
Thanks Tim Graham and Markus Holtermann for review.
2017-01-15 13:37:18 +01:00
Matthew Schinckel 236ebe94bf Fixed #27149 -- Added Subquery and Exists database expressions.
Thanks Josh Smeaton for Oracle fixes.
2017-01-14 09:12:24 -05:00
Florian Apolloner 84c1826ded Fixed #27718 -- Added QuerySet.union(), intersection(), difference().
Thanks Mariusz Felisiak for review and Oracle assistance.
Thanks Tim Graham for review and writing docs.
2017-01-14 08:32:07 -05:00
Simon Charette 973cfd2ef5 Refs #20483 -- Implemented cascaded flush on Oracle.
The initial implementation added support for PostgreSQL but it is also required
on Oracle (13b7f299de).

Thanks Mariusz Felisiak for the foreign key retreival queries.
2017-01-13 08:50:03 -05:00
François Freitag f3b7c05936 Refs #16614 -- Made QuerySet.iterator() use server-side cursors on PostgreSQL.
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.
2017-01-11 09:25:37 -05:00
David Szotten 7a6863c338 Fixed #27690 -- Removed time.sleep(1) before dropping the test database.
Uncertain if this is needed, but no failures have appeared so far.
2017-01-06 15:28:22 -05:00
anabelensc 1c12df4aa6 Fixed #25912 -- Added binary left/right shift operators to F expressions.
Thanks Mariusz Felisiak for review and MySQL advice.
2017-01-03 14:15:46 -05:00
Mariusz Felisiak fd2f7e4767 Fixed #27681 -- Fixed binary &/| operators for negative values on MySQL. 2017-01-03 12:41:44 -05:00
Josh Smeaton 26c9f529c9 Refs #27632 -- Simplified params dict creation for Oracle (#7772) 2017-01-01 12:39:03 +11:00
Andrew Nester 69b7d4b116 Fixed #27458 -- Fixed invalid sequence/index names when using "USER"."TABLE" db_table on Oracle. 2016-12-30 17:11:12 -05:00
Mariusz Felisiak 7d14889aa3 Fixed #27615 -- Used timedeltas as arguments to Oracle database driver.
Removed unused DatabaseFeatures.driver_supports_timedeltas workaround.
2016-12-29 15:49:18 -05:00
Tim Graham fae56427e1 Fixed #27649 -- Bumped required cx_Oracle to 5.2.
Removed obsolete workarounds from 1aa4889808
and dcf3be7a62.
2016-12-29 12:45:25 -05:00
Adam Chainz 391c450fba Refs #25415 -- Made MySQL backend skip field validation of unsupported models. 2016-12-29 12:01:48 -05:00
Simon Charette 813805833a Fixed #27631 -- Prevented execution of transactional DDL statements when unsupported.
Executing a DDL statement during a transaction on backends that don't support
it silently commits, leaving atomic() in an incoherent state.

While schema_editor.execute() could technically be used to execute DML
statements such usage should be uncommon as these are usually performed through
the ORM. In other cases schema_editor.connection.execute() can be used to
circumvent this check.

Thanks Adam and Tim for the review.
2016-12-28 19:43:32 -05:00
Mariusz Felisiak 4579c3f6b8 Refs #27632 -- Unified query parameters by their types and values on Oracle.
Fixed Python 2 regression in 6dbe56ed78.

Thanks Simon Charette for the implementation idea.
2016-12-28 17:20:42 -05:00
Mariusz Felisiak 6dbe56ed78 Fixed #27632 -- Unified query parameters by their values on Oracle. 2016-12-28 08:14:14 -05:00
Simon Charette cd7efa2033 Fixed #25492 -- Checked deferred foreign key constraints before dropping them.
This allows running foreign key data and schema altering operations in the
same migration on PostgreSQL.

Thanks Tim for review.
2016-12-24 13:53:11 -05:00
Mariusz Felisiak cc0bb07013 Refs #19884 -- Removed DatabaseFeatures.can_introspect_max_length.
Unused (always True) after 3e43d24ad3.
2016-12-19 16:16:11 -05:00