From: Mike Bayer Date: Sun, 30 Sep 2012 22:24:51 +0000 (-0400) Subject: - [bug] Fixed bug where reflection of primary key constraint X-Git-Tag: rel_0_7_9~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a856dc9217dc09fe9f0980cbc11ea387f2c17583;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - [bug] Fixed bug where reflection of primary key constraint would double up columns if the same constraint/table existed in multiple schemas. --- diff --git a/CHANGES b/CHANGES index 9543c0a5fd..09e5d6f50b 100644 --- a/CHANGES +++ b/CHANGES @@ -205,6 +205,10 @@ CHANGES attribute, causing the construct to not compile correctly a second time. [ticket:2545] + - [bug] Fixed bug where reflection of primary key constraint + would double up columns if the same constraint/table + existed in multiple schemas. + 0.7.8 ===== - orm diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index c544d1d48e..e86715fc29 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1454,6 +1454,7 @@ class MSDialect(default.DefaultDialect): # Primary key constraints s = sql.select([C.c.column_name, TC.c.constraint_type], sql.and_(TC.c.constraint_name == C.c.constraint_name, + TC.c.table_schema == C.c.table_schema, C.c.table_name == tablename, C.c.table_schema == current_schema) )