summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r--lib/sqlalchemy/sql.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py
index 0961cd4ee..4c720dfa2 100644
--- a/lib/sqlalchemy/sql.py
+++ b/lib/sqlalchemy/sql.py
@@ -1592,6 +1592,13 @@ class ColumnCollection(util.OrderedProperties):
The key attribute of the column will be used as the hash key
for this dictionary.
"""
+
+ # Allow an aliased column to replace an unaliased column of the
+ # same name.
+ if self.has_key(column.name):
+ other = self[column.name]
+ if other.name == other.key:
+ del self[other.name]
self[column.key] = column
def remove(self, column):