Ticket #17273: oracle_compiler.diff

File oracle_compiler.diff, 848 bytes (added by rodolfo.3+django@…, 13 years ago)

Changes into the Oracle backend

  • django/db/backends/oracle/compiler.py

     
    4646            # and OFFSET on Oracle.
    4747            high_where = ''
    4848            if self.query.high_mark is not None:
    49                 high_where = 'WHERE ROWNUM <= %d' % (self.query.high_mark,)
    50             sql = 'SELECT * FROM (SELECT ROWNUM AS "_RN", "_SUB".* FROM (%s) "_SUB" %s) WHERE "_RN" > %d' % (sql, high_where, self.query.low_mark)
     49                high_where = '"_RN" <= %d AND ' % (self.query.high_mark,)
     50            sql = 'SELECT * FROM (SELECT ROWNUM AS "_RN", "_SUB".* FROM (%s) "_SUB") WHERE %s"_RN" > %d' % (sql, high_where, self.query.low_mark)
    5151
    5252        return sql, params
    5353
Back to Top