diff options
| author | Tim Graham <timograham@gmail.com> | 2020-01-19 18:30:54 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-01-20 20:03:35 +0100 |
| commit | 227d0c7365cfd0a64d021cb9bdcf77bed2d3f170 (patch) | |
| tree | 3d166c4ca5e98352857cf08f92ec2c1c84bb73ec /django/db/backends/base/operations.py | |
| parent | 2a2ea4ee18fdcf2c95bf6435bc63b74623e3085b (diff) | |
Fixed #31183 -- Added a feature flag for "<db> only supports UNBOUNDED together with PRECEDING and FOLLOWING".
Diffstat (limited to 'django/db/backends/base/operations.py')
| -rw-r--r-- | django/db/backends/base/operations.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py index 43220a18bc..6e1187fd37 100644 --- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -658,7 +658,16 @@ class BaseDatabaseOperations: return self.window_frame_start(start), self.window_frame_end(end) def window_frame_range_start_end(self, start=None, end=None): - return self.window_frame_rows_start_end(start, end) + start_, end_ = self.window_frame_rows_start_end(start, end) + if ( + self.connection.features.only_supports_unbounded_with_preceding_and_following and + ((start and start < 0) or (end and end > 0)) + ): + raise NotSupportedError( + '%s only supports UNBOUNDED together with PRECEDING and ' + 'FOLLOWING.' % self.connection.display_name + ) + return start_, end_ def explain_query_prefix(self, format=None, **options): if not self.connection.features.supports_explaining_query_execution: |
