]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Raise if ForeignKeyConstraint created with different numbers of
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 May 2017 14:17:11 +0000 (10:17 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 May 2017 19:57:03 +0000 (15:57 -0400)
commita78718b9340e9840a470300932af178ce57c0f7d
treed94c45715d4f0dbecdd3be466f52dc5e8c333ac7
parentde11c5217b4c62f86dfd05a28689159095ab1024
Raise if ForeignKeyConstraint created with different numbers of
local and remote columns.

An :class:`.ArgumentError` is now raised if a
:class:`.ForeignKeyConstraint` object is created with a mismatched
number of "local" and "remote" columns, which otherwise causes the
internal state of the constraint to be incorrect.   Note that this
also impacts the condition where a dialect's reflection process
produces a mismatched set of columns for a foreign key constraint.

Downstream DB2 dialect has been reported as potentially causing this
scenario.

Change-Id: Id51c34a6c43749bb582639f9c1dc28723482f0e5
Fixes: #3949
References: #3998
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/sql/schema.py
test/sql/test_metadata.py