Changes between Version 3 and Version 4 of Ticket #33766


Ignore:
Timestamp:
Jun 3, 2022, 7:48:32 PM (3 years ago)
Author:
Daniel Schaffer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33766 – Description

    v3 v4  
    3232`django_filtered_relation_coalesce_repro/test/test_job_manager.py`  contains a failing test that reproduces the issue, and a passing test that demonstrates the workaround.
    3333
     34Here's the stringified representation of the query - note the missing `JOIN` to `django_filtered_relation_coalesce_repro_workersubstitution`, even though it's referenced in the `COALESCE` expression:
     35
     36{{{
     37SELECT
     38  `django_filtered_relation_coalesce_repro_job`.`id`,
     39  `django_filtered_relation_coalesce_repro_job`.`company_id`,
     40  `django_filtered_relation_coalesce_repro_job`.`worker_id`,
     41  CASE WHEN job_worker_preference.`allow_assignments` THEN 1 ELSE 0 END AS `is_allowed`
     42FROM `django_filtered_relation_coalesce_repro_job`
     43INNER JOIN `django_filtered_relation_coalesce_repro_company`
     44ON (`django_filtered_relation_coalesce_repro_job`.`company_id` = `django_filtered_relation_coalesce_repro_company`.`id`)
     45LEFT OUTER JOIN `django_filtered_relation_coalesce_repro_workerpreference` job_worker_preference
     46ON (`django_filtered_relation_coalesce_repro_company`.`id` = job_worker_preference.`company_id` AND
     47    ((job_worker_preference.`company_id` = `django_filtered_relation_coalesce_repro_job`.`company_id` AND
     48      job_worker_preference.`worker_id` = COALESCE(`django_filtered_relation_coalesce_repro_job`.`worker_id`,
     49                                                   `django_filtered_relation_coalesce_repro_workersubstitution`.`worker_id`))))
     50
     51}}}
Back to Top