diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2017-08-30 12:30:17 -0400 |
---|---|---|
committer | Gerrit Code Review <gerrit@awstats.zzzcomputing.com> | 2017-08-30 12:30:17 -0400 |
commit | 28e6c79cf3665fce42b12ccdfa138bf5ca967cb5 (patch) | |
tree | df16a94907dbf16ba6488ae1b61be3407f9bba60 | |
parent | 51c24329181f8bef17348f9b3899303569d32c81 (diff) | |
parent | 3e855cd277aac8a71be31082cbc11927005f5b37 (diff) | |
download | sqlalchemy-28e6c79cf3665fce42b12ccdfa138bf5ca967cb5.tar.gz |
Merge "Ignore SQL Server "heap" indexes"
-rw-r--r-- | doc/build/changelog/unreleased_12/4059.rst | 8 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/mssql/base.py | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/build/changelog/unreleased_12/4059.rst b/doc/build/changelog/unreleased_12/4059.rst new file mode 100644 index 000000000..bedbdd17d --- /dev/null +++ b/doc/build/changelog/unreleased_12/4059.rst @@ -0,0 +1,8 @@ +.. change:: + :tags: bug, mssql + :tickets: 4059 + + Added a rule to SQL Server index reflection to ignore the so-called + "heap" index that is implicitly present on a table that does not + specify a clustered index. + diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py index 05381d671..d526c685c 100644 --- a/lib/sqlalchemy/dialects/mssql/base.py +++ b/lib/sqlalchemy/dialects/mssql/base.py @@ -1939,7 +1939,7 @@ class MSDialect(default.DefaultDialect): "join sys.schemas as sch on sch.schema_id=tab.schema_id " "where tab.name = :tabname " "and sch.name=:schname " - "and ind.is_primary_key=0", + "and ind.is_primary_key=0 and ind.type != 0", bindparams=[ sql.bindparam('tabname', tablename, sqltypes.String(convert_unicode=True)), |