get_cached_row and hence select_related dead loop on circular ForeignKeys
|Reported by:||bangcok_dangerus ( at ] hotmail.com||Owned by:||Adrian Holovaty|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
select_related fails if there's a loop in ForeignKey relationships. fill_table_cache, which recursively follows ForeignKeys to generate the SQL query, was mentioned as a candidate for this in #2549 . This should now be fixed by the patch in #2874. get_cached_row, which recursively populates objects from the result of the query, suffers from the same problem.
I'll try get a patch up for this at some point.