| 34 | Here'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 | {{{ |
| 37 | SELECT |
| 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` |
| 42 | FROM `django_filtered_relation_coalesce_repro_job` |
| 43 | INNER JOIN `django_filtered_relation_coalesce_repro_company` |
| 44 | ON (`django_filtered_relation_coalesce_repro_job`.`company_id` = `django_filtered_relation_coalesce_repro_company`.`id`) |
| 45 | LEFT OUTER JOIN `django_filtered_relation_coalesce_repro_workerpreference` job_worker_preference |
| 46 | ON (`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 | }}} |