summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/oracle/base.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/sqlalchemy/dialects/oracle/base.py b/lib/sqlalchemy/dialects/oracle/base.py
index 5e912a0c2..34c665fbe 100644
--- a/lib/sqlalchemy/dialects/oracle/base.py
+++ b/lib/sqlalchemy/dialects/oracle/base.py
@@ -1898,7 +1898,7 @@ class OracleDialect(default.DefaultDialect):
dblink=dblink,
info_cache=kw.get("info_cache"),
)
- pkeys = pk_constraint["constrained_columns"]
+
uniqueness = dict(NONUNIQUE=False, UNIQUE=True)
enabled = dict(DISABLED=False, ENABLED=True)
@@ -1906,9 +1906,22 @@ class OracleDialect(default.DefaultDialect):
index = None
for rset in rp:
+ index_name_normalized = self.normalize_name(rset.index_name)
+
+ # skip primary key index. This is refined as of
+ # [ticket:5421]. Note that ALL_INDEXES.GENERATED will by "Y"
+ # if the name of this index was generated by Oracle, however
+ # if a named primary key constraint was created then this flag
+ # is false.
+ if (
+ pk_constraint
+ and index_name_normalized == pk_constraint["name"]
+ ):
+ continue
+
if rset.index_name != last_index_name:
index = dict(
- name=self.normalize_name(rset.index_name),
+ name=index_name_normalized,
column_names=[],
dialect_options={},
)
@@ -1930,18 +1943,6 @@ class OracleDialect(default.DefaultDialect):
)
last_index_name = rset.index_name
- def upper_name_set(names):
- return {i.upper() for i in names}
-
- pk_names = upper_name_set(pkeys)
- if pk_names:
-
- def is_pk_index(index):
- # don't include the primary key index
- return upper_name_set(index["column_names"]) == pk_names
-
- indexes = [idx for idx in indexes if not is_pk_index(idx)]
-
return indexes
@reflection.cache