From 1258d1ed9e8064e08fd77d2dc3938fcebc130800 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 31 Mar 2010 13:52:57 -0400 Subject: [PATCH] - 'cycle' is a stack here - needs to be a list. --- CHANGES | 4 ++++ lib/sqlalchemy/topological.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index cc3d9b6195..39bba20bbf 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,10 @@ CHANGES "delete-orphan", or will simply detach it otherwise. [ticket:1754] + - Fixed a potential issue in topological cycle detection + introduced in 0.6beta3, for units of work with long + dependency cycles. + - sql - Restored some bind-labeling logic from 0.5 which ensures that tables with column names that overlap another column diff --git a/lib/sqlalchemy/topological.py b/lib/sqlalchemy/topological.py index d35213f6b5..9e584ff4e0 100644 --- a/lib/sqlalchemy/topological.py +++ b/lib/sqlalchemy/topological.py @@ -270,7 +270,7 @@ def _find_cycles(edges): for (n, key) in edges.edges_by_parent(node): if key in cycle: continue - cycle.add(key) + cycle.append(key) if key is goal: cycset = set(cycle) for x in cycle: @@ -287,7 +287,7 @@ def _find_cycles(edges): cycle.pop() for parent in edges.get_parents(): - traverse(parent, set(), parent) + traverse(parent, [], parent) unique_cycles = set(tuple(s) for s in cycles.values()) -- 2.47.3