Changes between Initial Version and Version 1 of Ticket #26433, comment 1


Ignore:
Timestamp:
Mar 31, 2016, 5:15:27 AM (9 years ago)
Author:
Anssi Kääriäinen

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26433, comment 1

    initial v1  
    221. Instead of raising EmptyResultSet we generate sql, params = "1 = %s", (EMPTY_PARAM,).
    332. EMPTY_PARAM is converted to 0 when the SQL is executed.
    4 3. When generating the SQL for a queryset which isn't a subquery of another queryset, we check for existence of EMPTY_PARAM in the params generated for the where clause. If one is found, we know we don't need to execute the queryset at all.
    5 4. In all other cases we run the query with the empty param. The condition is always going to fail in the generated SQL, but that is exactly what we want for this ticket.
     43. We check for EMPTY_PARAM in the params inside WhereNode and do necessary conversions for full/empty resultset cases when generating the SQL.
     54. When generating the SQL for a queryset which isn't a subquery of another queryset, we check for existence of EMPTY_PARAM in the params generated for the where clause. If one is found, we know we don't need to execute the queryset at all.
     65. In all other cases we run the query with the empty param. The condition is always going to fail in the generated SQL, but that is exactly what we want for this ticket.
    67
    78This should also solve #26430 by the "isn't a subquery" condition in rule 3.
Back to Top