Ticket #7698: query.py.diff
File query.py.diff, 1.4 KB (added by , 16 years ago) |
---|
-
usr/lib/python2.5/site-packages/django/db/models/sql/query.py
281 281 282 282 # FIXME: Pull this out to make life easier for Oracle et al. 283 283 if with_limits: 284 if self.high_mark :284 if self.high_mark is not None: 285 285 result.append('LIMIT %d' % (self.high_mark - self.low_mark)) 286 if self.low_mark :287 if not self.high_mark:286 if self.low_mark is not None: 287 if self.high_mark is None: 288 288 val = self.connection.ops.no_limit_value() 289 289 if val: 290 290 result.append('LIMIT %d' % val) … … 1248 1248 constraints. So low is added to the current low value and both will be 1249 1249 clamped to any existing high value. 1250 1250 """ 1251 if high :1251 if high is not None: 1252 1252 if self.high_mark: 1253 1253 self.high_mark = min(self.high_mark, self.low_mark + high) 1254 1254 else: 1255 1255 self.high_mark = self.low_mark + high 1256 if low :1256 if low is not None: 1257 1257 if self.high_mark: 1258 1258 self.low_mark = min(self.high_mark, self.low_mark + low) 1259 1259 else: