Commit Graph

208 Commits

Author SHA1 Message Date
Louise Grandjonc cf7ef5d258 [3.0.x] Fixed #30826 -- Fixed crash of many JSONField lookups when one hand side is key transform.
Regression in 6c3dfba892.

Backport of 7d1bf29977 from master
2019-10-11 11:51:14 +02:00
Nasir Hussain 685d956764 [3.0.x] Fixed #30758 -- Made RangeFields use multiple hidden inputs for initial data.
Backport of faf4b988fe from master.
2019-09-17 12:21:02 +02:00
Simon Charette 574154ef56 [3.0.x] Fixed #30769 -- Fixed a crash when filtering against a subquery JSON/HStoreField annotation.
This was a regression introduced by 7deeabc7c7
to address CVE-2019-14234.

Thanks Tim Kleinschmidt for the report and Mariusz for the tests.

Backport of 6c3dfba892 from master
2019-09-16 08:53:02 +02:00
Mariusz Felisiak 521308e575 Fixed #30715 -- Fixed crash of ArrayField lookups on ArrayAgg annotations over AutoField. 2019-08-23 10:43:08 +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
Mariusz Felisiak 1f8382d34d
Fixed #30672 -- Fixed crash of JSONField/HStoreField key transforms on expressions with params.
Regression in 4f5b58f5cd.

Thanks Florian Apolloner for the report and helping with tests.
2019-08-14 15:25:35 +02:00
Mariusz Felisiak c19ad2da4b
Fixed #30704 -- Fixed crash of JSONField nested key and index transforms on expressions with params.
Thanks Florian Apolloner for the report and helping with tests.
2019-08-13 08:42:17 +02:00
Mariusz Felisiak 0e02e496cd Added tests for using ArrayField's IndexTransform/SliceTransform on expressions with params. 2019-08-05 14:16:25 +02:00
Mariusz Felisiak 7deeabc7c7 Fixed CVE-2019-14234 -- Protected JSONField/HStoreField key and index lookups against SQL injection.
Thanks to Sage M. Abdullah for the report and initial patch.
Thanks Florian Apolloner for reviews.
2019-08-01 09:24:54 +02:00
Mads Jensen a3417282ac Fixed #29824 -- Added support for database exclusion constraints on PostgreSQL.
Thanks to Nick Pope and Mariusz Felisiak for review.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-07-16 18:04:41 +02:00
Mariusz Felisiak cf79f92abe
Simplified tests for PostgreSQL constraints. 2019-07-16 16:56:44 +02:00
Mariusz Felisiak 7991111af1
Fixed #30621 -- Fixed crash of __contains lookup for Date/DateTimeRangeField when the right hand side is the same type.
Thanks Tilman Koschnick for the report and initial patch.
Thanks Carlton Gibson the review.

Regression in 6b048b364c.
2019-07-10 10:33:36 +02:00
Chason Chaffin c238e65e29 Fixed #30596 -- Fixed SplitArrayField.has_changed() for non-string base fields.
Thanks to Evgeniy Krysanov for the report and the idea to use to_python.
Thanks to Mariusz Felisiak for the test case.
2019-07-03 13:35:51 +02:00
Jon Dufresne 42b9a23267 Fixed #30400 -- Improved typography of user facing strings.
Thanks Claude Paroz for assistance with translations.
2019-06-28 16:46:18 +02:00
Caio Ariede a3f91891d2 Fixed #30315 -- Fixed crash of ArrayAgg and StringAgg with ordering when used in Subquery. 2019-05-28 10:05:50 +02:00
Thomasina Lee c38e7a79f4 Fixed #30488 -- Removed redundant Coalesce call in SQL generated by SearchVector.
Regression in 405c836336.
2019-05-20 08:34:06 +02:00
Florian Apolloner d329484534 Ensured that our django checkout is in the pythonpath during tests.
This fixes an issue with postgres_tests.test_integration.PostgresIntegrationTests
which would not find Django in a CI run.
2019-05-14 19:43:56 +02:00
Simon Charette 405c836336 Fixed #30385 -- Restored SearchVector(config) immutability.
Regression in 1a28dc3887.

The usage of CONCAT to allow SearchVector to deal with non-text fields
made the generated expression non-IMMUTABLE which prevents a functional
index to be created for it.

Using a combination of COALESCE and ::text makes sure the expression
preserves its immutability.

Refs #29582. Thanks Andrew Brown for the report, Nick Pope for the
review.
2019-04-23 08:11:33 +02:00
Tomer Chachamu ceab25bc6d Refs #28762 -- Added test for aggregating over a function with ArrayField parameters.
Fixed in d87bd29c4f.
2019-04-18 12:54:19 +02:00
Mariusz Felisiak 654614b38e
Refs #28767 -- Added test for annotating Value() with empty list as an ArrayField.
Fixed in 3af695eda2.
2019-04-18 12:06:39 +02:00
can d87bd29c4f Fixed #30335, #29139 -- Fixed crash when ordering or aggregating over a nested JSONField key transform. 2019-04-18 07:16:50 +02:00
Simone Pellizzari d0315584b5
Fixed #30332 -- Fixed crash of ordering by expressions with params in ArrayAgg and StringAgg. 2019-04-06 14:23:29 +02:00
Simone Pellizzari 47a1f2a06f
Refs #26067 -- Added more tests for ordering in StringAgg. 2019-04-06 13:41:46 +02:00
oliver 2aaabe2004 Used QuerySet.bulk_create() in a couple of postgres tests.
Follow up to 0ce2ad9ca4.
2019-03-21 18:05:29 -04:00
Simon Charette 386d89ab55
Fixed #30258 -- Adjusted postgres schema value quoting of ranges.
Thanks Tilman Koschnick for the report and patch.
2019-03-18 09:05:39 +01:00
Mariusz Felisiak f69c7bbdce
Refs #29408 -- Cosmetic edits for validation of related fields and lookups in model Meta.ordering.
Follow up to 440505cb2c.
2019-03-01 19:38:21 +01:00
Hasan Ramezani 440505cb2c Fixed #29408 -- Added validation of related fields and lookups in model Meta.ordering. 2019-03-01 17:09:33 +01:00
Vinay Karanam 5a36c81f58 Fixed #29391 -- Made PostgresSimpleLookup respect Field.get_db_prep_value(). 2019-02-09 18:05:50 -05:00
Jon Dufresne 099c36d546 Replaced manual current directory management with subprocess's cwd argument. 2019-02-05 11:01:36 -05:00
Tim Graham 39ebdf5a3c Fixed #30155 -- Dropped support for PostgreSQL 9.4 and PostGIS 2.1. 2019-02-04 18:07:02 -05:00
Tim Graham 2de7eb6f4d Refs #30111 -- Fixed test cleanup in postgres_tests/test_integration.py.
Fixed "ERROR: Step ‘Publish JUnit test result report’ failed: No test report
files were found. Configuration error?" on Jenkins because report files were
put in tests/postgres_tests.
2019-01-23 11:34:55 -05:00
Nasir Hussain 2804b8d215 Fixed #30111 -- Fixed AppRegistryNotReady error with django.contrib.postgres in INSTALLED_APPS.
Regression in e192223ed9.
2019-01-22 17:49:30 -05:00
Simon Charette b2c598e30d Removed unnecessary skipUnlessDBFeature.
None of the tests interact with the database.
2019-01-13 21:48:40 -05:00
can e192223ed9 Fixed #29738 -- Allowed serializing psycopg2 range types in migrations. 2019-01-11 19:32:26 -05:00
Jaap Roes 8a1a919468 Fixed #29997 -- Allowed combining SearchQuerys with different configs.
Seems to be a needless restriction in
978a00e39f.
2018-11-30 09:42:50 -05:00
Tim Graham 41db8cb252
Used assertCountEqual() in contrib.postgres.search tests. 2018-11-29 14:43:53 -05:00
Simon Charette 7f63b894c0 Adjusted code style of a few test data setup methods.
Thanks Mariusz for suggesting it.
2018-11-27 09:48:22 -05:00
Simon Charette 84e7a9f4a7 Switched setUp() to setUpTestData() where possible in Django's tests. 2018-11-27 09:35:17 -05:00
Tim Graham 193c109327 Switched TestCase to SimpleTestCase where possible in Django's tests. 2018-11-27 08:58:44 -05:00
Sergey Fedoseev 80ba7a881f Fixed cached_properties that share a common property.
The aliases aren't cached and thus the old usage will be an error after
refs #29478.
2018-11-19 08:59:46 -05:00
Simon Charette 2f120ac517 Fixed #29945 -- Moved contrib.postgres uninstallation logic to the app config. 2018-11-12 11:15:48 -05:00
Jayantha Gumballi dfcdc8992f Fixed #29886 -- Fixed unaccent lookup when PostgreSQL's standard_conforming_strings option is off.
Thanks Tom McClure for the patch.
2018-11-01 11:14:34 -04:00
Mads Jensen a906c98982 Fixed #29547 -- Added support for partial indexes.
Thanks to Ian Foote, Mariusz Felisiak, Simon Charettes, and
Markus Holtermann for comments and feedback.
2018-10-29 19:34:54 -04:00
Jon Dufresne 31c0348687 Fixed postgres_tests.test_signals.OIDTests when run in isolation. 2018-10-09 09:23:36 -04:00
Stefano Chiodino 6de7f9ec60 Fixed #29598 -- Deprecated FloatRangeField in favor of DecimalRangeField. 2018-10-02 19:17:23 -04:00
Tom Forbes 9cbdb44014 Fixed #23646 -- Added QuerySet.bulk_update() to efficiently update many models. 2018-09-18 16:14:44 -04:00
Claude Paroz f5e347a640 Fixed #27899 -- Added support for phrase/raw searching in SearchQuery.
Thanks Tim Graham, Nick Pope, and Claude Paroz for contribution and review.
2018-09-17 12:03:52 -04:00
Tom Forbes a3df7574f9 Fixed #29644 -- Made SearchQuery.__str__() reflect negation and grouping. 2018-08-15 16:47:23 -04:00
Nick Pope 743d28f553 Refs #27869 -- Added PostgreSQL version check for GinIndex support. 2018-08-02 11:53:35 -04:00
Nick Pope ff9543b351 Refs #25809, #28990 -- Added PostgreSQL version check for BrinIndex support. 2018-08-02 11:50:40 -04:00