From: Mike Bayer Date: Wed, 31 Mar 2010 17:52:57 +0000 (-0400) Subject: - 'cycle' is a stack here - needs to be a list. X-Git-Tag: rel_0_6_0~23^2~15^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1258d1ed9e8064e08fd77d2dc3938fcebc130800;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - 'cycle' is a stack here - needs to be a list. --- 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())