summaryrefslogtreecommitdiff
path: root/django/db/backends/oracle/query.py
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-08-05 17:15:33 +0000
committerJustin Bronn <jbronn@gmail.com>2008-08-05 17:15:33 +0000
commitaa239e3e5405933af6a29dac3cf587b59a099927 (patch)
treeea2cbd139c9a8cf84c09e0b2008bff70e05927ef /django/db/backends/oracle/query.py
parent45b73c9a4685809236f84046cc7ffd32a50db958 (diff)
downloaddjango-attic/gis.tar.gz
gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk.archive/attic/gisattic/gis
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/oracle/query.py')
-rw-r--r--django/db/backends/oracle/query.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/django/db/backends/oracle/query.py b/django/db/backends/oracle/query.py
index 7e50c7b5db..49e1c4131c 100644
--- a/django/db/backends/oracle/query.py
+++ b/django/db/backends/oracle/query.py
@@ -87,9 +87,11 @@ def query_class(QueryClass, Database):
If 'with_limits' is False, any limit/offset information is not
included in the query.
"""
+
# The `do_offset` flag indicates whether we need to construct
# the SQL needed to use limit/offset w/Oracle.
- do_offset = with_limits and (self.high_mark or self.low_mark)
+ do_offset = with_limits and (self.high_mark is not None
+ or self.low_mark)
# If no offsets, just return the result of the base class
# `as_sql`.
@@ -117,7 +119,7 @@ def query_class(QueryClass, Database):
# Getting the selection SQL and the params, which has the `rn`
# extra selection SQL.
self.extra_select['rn'] = 'ROW_NUMBER() OVER (ORDER BY %s )' % rn_orderby
- sql, params= super(OracleQuery, self).as_sql(with_limits=False,
+ sql, params = super(OracleQuery, self).as_sql(with_limits=False,
with_col_aliases=True)
# Constructing the result SQL, using the initial select SQL
@@ -126,7 +128,7 @@ def query_class(QueryClass, Database):
# Place WHERE condition on `rn` for the desired range.
result.append('WHERE rn > %d' % self.low_mark)
- if self.high_mark:
+ if self.high_mark is not None:
result.append('AND rn <= %d' % self.high_mark)
# Returning the SQL w/params.
@@ -148,4 +150,3 @@ def query_class(QueryClass, Database):
_classes[QueryClass] = OracleQuery
return OracleQuery
-