Ticket #12192: 12192-patch1-trunk-r12492.diff

File 12192-patch1-trunk-r12492.diff, 715 bytes (added by Ramiro Morales, 15 years ago)
  • django/db/models/sql/compiler.py

    diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
    a b  
    116116
    117117        if with_limits:
    118118            if self.query.high_mark is not None:
    119                 result.append('LIMIT %d' % (self.query.high_mark - self.query.low_mark))
     119                if self.query.high_mark != self.query.low_mark:
     120                    result.append('LIMIT %d' % (self.query.high_mark - self.query.low_mark))
     121                else:
     122                    return '', ()
    120123            if self.query.low_mark:
    121124                if self.query.high_mark is None:
    122125                    val = self.connection.ops.no_limit_value()
Back to Top