diff options
| author | Simon Charette <charette.s@gmail.com> | 2019-01-15 21:48:12 -0600 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-02-09 08:47:41 -0500 |
| commit | 64d5bafbc674db07537111d5fcbd113e32088d44 (patch) | |
| tree | 1476780b9f9face762e68aa926073c338605c55a /django/db | |
| parent | ebd2fe186186800af343f0041a0904381b4dfc44 (diff) | |
Fixed #30027 -- Errored out on Window function usage if unsupported.
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/models/expressions.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index 6afe68bac0..ccb67876e2 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -7,6 +7,7 @@ from django.core.exceptions import EmptyResultSet, FieldError from django.db import connection from django.db.models import fields from django.db.models.query_utils import Q +from django.db.utils import NotSupportedError from django.utils.deconstruct import deconstructible from django.utils.functional import cached_property from django.utils.hashable import make_hashable @@ -1237,6 +1238,8 @@ class Window(Expression): def as_sql(self, compiler, connection, template=None): connection.ops.check_expression_support(self) + if not connection.features.supports_over_clause: + raise NotSupportedError('This backend does not support window expressions.') expr_sql, params = compiler.compile(self.source_expression) window_sql, window_params = [], [] |
