Ticket #12192: 12192-patch2.diff

File 12192-patch2.diff, 556 bytes (added by Ramiro Morales, 15 years ago)

This one doesn even generate the SQL of the query if it's going to have LIMIT 0

  • django/db/models/sql/query.py

    diff -r 1fe026327305 django/db/models/sql/query.py
    a b  
    396396        If 'with_limits' is False, any limit/offset information is not included
    397397        in the query.
    398398        """
     399        if with_limits and self.high_mark == self.low_mark:
     400            return '', ()
     401
    399402        self.pre_sql_setup()
    400403        out_cols = self.get_columns(with_col_aliases)
    401404        ordering, ordering_group_by = self.get_ordering()
Back to Top