summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-06-03 17:03:15 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-06-03 17:03:15 -0400
commit8a865a4d1f7bf7d399a551ae1c3f93e668ccc8aa (patch)
treea5fc83a316ce76951380007dd1495754aab1dcaa /lib/sqlalchemy/schema.py
parentec04620f1fe609881ed2ad4a3d5b2fe313f4efa4 (diff)
downloadsqlalchemy-8a865a4d1f7bf7d399a551ae1c3f93e668ccc8aa.tar.gz
Fixed bug whereby joining a select() of a table "A" with multiple
foreign key paths to a table "B", to that table "B", would fail to produce the "ambiguous join condition" error that would be reported if you join table "A" directly to "B"; it would instead produce a join condition with multiple criteria. [ticket:2738]
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r--lib/sqlalchemy/schema.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index 3d59e8291..94df6751c 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -1134,7 +1134,8 @@ class Column(SchemaItem, expression.ColumnClause):
information is not transferred.
"""
- fk = [ForeignKey(f.column) for f in self.foreign_keys]
+ fk = [ForeignKey(f.column, _constraint=f.constraint)
+ for f in self.foreign_keys]
if name is None and self.name is None:
raise exc.InvalidRequestError("Cannot initialize a sub-selectable"
" with this Column object until it's 'name' has "