summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-03-21 13:12:15 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-03-21 13:12:15 -0400
commitc09c21c9f31826e126b97d6318a9df66986af774 (patch)
treecd4491e60aa33b8f44bc5279f96e189fe4597f47 /lib/sqlalchemy/sql/selectable.py
parent10593e77689cf3c9d6d0de957632d42fd74bf697 (diff)
downloadsqlalchemy-c09c21c9f31826e126b97d6318a9df66986af774.tar.gz
- Fixed bug in new "label resolution" feature of :ticket:`2992` where
the string label placed in the order_by() or group_by() of a statement would place higher priority on the name as found inside the FROM clause instead of a more locally available name inside the columns clause. fixes #3335
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
-rw-r--r--lib/sqlalchemy/sql/selectable.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 6520f08fc..b5a7489bf 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -2680,7 +2680,8 @@ class Select(HasPrefixes, HasSuffixes, GenerativeSelect):
only_froms = dict(
(c.key, c) for c in
_select_iterables(self.froms) if c._allow_label_resolve)
- with_cols.update(only_froms)
+ for key, value in only_froms.items():
+ with_cols.setdefault(key, value)
return with_cols, only_froms