Refs #25894 -- Fixed evaluation of zero-length slices of QuerySet.values() on Oracle.
This commit is contained in:
parent
9af40f5df1
commit
ed1bcf0515
@ -12,9 +12,6 @@ class SQLCompiler(compiler.SQLCompiler):
|
|||||||
If 'with_limits' is False, any limit/offset information is not
|
If 'with_limits' is False, any limit/offset information is not
|
||||||
included in the query.
|
included in the query.
|
||||||
"""
|
"""
|
||||||
if with_limits and self.query.low_mark == self.query.high_mark:
|
|
||||||
return '', ()
|
|
||||||
|
|
||||||
# The `do_offset` flag indicates whether we need to construct
|
# The `do_offset` flag indicates whether we need to construct
|
||||||
# the SQL needed to use limit/offset with Oracle.
|
# the SQL needed to use limit/offset with Oracle.
|
||||||
do_offset = with_limits and (self.query.high_mark is not None
|
do_offset = with_limits and (self.query.high_mark is not None
|
||||||
|
@ -367,8 +367,6 @@ class SQLCompiler(object):
|
|||||||
refcounts_before = self.query.alias_refcount.copy()
|
refcounts_before = self.query.alias_refcount.copy()
|
||||||
try:
|
try:
|
||||||
extra_select, order_by, group_by = self.pre_sql_setup()
|
extra_select, order_by, group_by = self.pre_sql_setup()
|
||||||
if with_limits and self.query.low_mark == self.query.high_mark:
|
|
||||||
return '', ()
|
|
||||||
distinct_fields = self.get_distinct()
|
distinct_fields = self.get_distinct()
|
||||||
|
|
||||||
# This must come after 'select', 'ordering', and 'distinct' -- see
|
# This must come after 'select', 'ordering', and 'distinct' -- see
|
||||||
|
@ -1550,6 +1550,9 @@ class Query(object):
|
|||||||
else:
|
else:
|
||||||
self.low_mark = self.low_mark + low
|
self.low_mark = self.low_mark + low
|
||||||
|
|
||||||
|
if self.low_mark == self.high_mark:
|
||||||
|
self.set_empty()
|
||||||
|
|
||||||
def clear_limits(self):
|
def clear_limits(self):
|
||||||
"""
|
"""
|
||||||
Clears any existing limits.
|
Clears any existing limits.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user