]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Ensure Oracle index w/ col DESC etc. is reflected
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Aug 2017 19:52:28 +0000 (15:52 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 14 Aug 2017 05:18:06 +0000 (01:18 -0400)
commit1a990ee33239aa275567cb926a5b421b2087294b
treeedc023629e1f82a2d66e2a5ab6320681a0e91810
parente331da58a6d136aff824b43312424083090a7c90
Ensure Oracle index w/ col DESC etc. is reflected

Fixed bug where an index reflected under Oracle with an expression like
"column DESC" would not be returned, if the table also had no primary
key, as a result of logic that attempts to filter out the
index implicitly added by Oracle onto the primary key columns.

Reworked the "filter out the primary key index" logic in oracle
get_indexes() to be clearer.

This changeset also adds an internal check to ColumnCollection
to accomodate for the case of a column being added twice,
as well as adding a private _table argument to Index such that
reflection can specify the Table explicitly.  The _table
argument can become part of public API in a later revision
or release if needed.

Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa
Fixes: #4042
doc/build/changelog/unreleased_12/4042.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/testing/suite/test_reflection.py
test/base/test_utils.py
test/sql/test_metadata.py