mapper error with adjaceny list + joined tables [with test & patch]

Issue #2149 resolved
Former user created an issue

Attached is a test case which demonstrates a bug related to adjacency lists + joined tables. The test case is for 0.7, but I think the bug was introduced in 13cc1279f83f84b02d19ed8def0fcee09e9fddb1 of 0.5.

From what I can tell, it looks like ''RelationshipProperty._refers_to_parent_table()'' is incorrectly returning False for the test case's "supervisor" property, causing ''RelationshipProperty._determine_direction()'' to treat it as a normal relationship, not an adjacency.

The 0.4 ''_refers_to_parent_table()'' handled this correctly, but did not correctly handle the issue in ''test.orm.test_polymorph2:RelationshipTest8''. The replacement 0.5 version of ''_refers_to_parent_table()'' fixed that test case, causes the attached test case to fail instead.

Attached is a patch to ''_refers_to_parent_table()'' which seems to satisfy both the attached case, and ''RelationshipTest8'' simultaneously.

Comments (8)

  1. Mike Bayer repo owner

    might need to go with your patch temporarily, but it doesn't work for the attached case at the bottom. the logic in that block needs a deeper rethink...yet again.

  2. Former user Account Deleted

    Ah ha. I had a feeling there was a much cleaner solution than my original patch, but couldn't come up with it. And I can confirm 2149.patch works great in the program that led me to this bug originally :)

  3. Log in to comment