From: Philip Jenvey Date: Sat, 18 Jul 2009 23:15:55 +0000 (+0000) Subject: fix Select's _copy_internals not maintaining _froms' order X-Git-Tag: rel_0_6_6~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfc60a7068dad06eebfc6ffe0032058e7db7ad7f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix Select's _copy_internals not maintaining _froms' order --- diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 68117ee4b5..fd144a2101 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -3480,7 +3480,7 @@ class Select(_SelectBaseMixin, FromClause): self._reset_exported() from_cloned = dict((f, clone(f)) for f in self._froms.union(self._correlate)) - self._froms = set(from_cloned[f] for f in self._froms) + self._froms = util.OrderedSet(from_cloned[f] for f in self._froms) self._correlate = set(from_cloned[f] for f in self._correlate) self._raw_columns = [clone(c) for c in self._raw_columns] for attr in ('_whereclause', '_having', '_order_by_clause', '_group_by_clause'):