#16715: Wrong JOIN with nested null-able foreign keys -------------------------------------+------------------------------------- Reporter: sebastian | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: SVN (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: join, values, | Needs documentation: 0 nested, foreign key, null-able | Patch needs improvement: 0 Has patch: 1 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by akaariai): I think the approach in the sql/compiler.py is correct. However the approach in sql/query.py is not correct in my opinion. What the NULLABLE in alias_map tuples mean, is if the join is nullable considered separate from the whole query. It is the responsibility of join promotion to do the correct promotions in the join chain, taking in account the parent joins. See attached patch for an approach doing this. I think my patch is actually simplifying the code while at the same time correcting this problem. However I am not yet at all certain it is actually correct. At least it passes the test :) -- Ticket URL: <https://code.djangoproject.com/ticket/16715#comment:11> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.