Skip to content

Commit

Permalink
optimize: oracle index (apache#1583)
Browse files Browse the repository at this point in the history
Signed-off-by: slievrly <slievrly@163.com>
  • Loading branch information
slievrly authored and zjinlei committed Sep 6, 2019
1 parent 6c7df96 commit 7696cd8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ private static TableMeta resultSetMetaToSchema(DatabaseMetaData dbmd, String tab
index.setAscOrDesc(rsIndex.getString("ASC_OR_DESC"));
index.setCardinality(rsIndex.getInt("CARDINALITY"));
index.getValues().add(col);
if ("PRIMARY".equalsIgnoreCase(indexName)) {
index.setIndextype(IndexType.PRIMARY);
} else if (!index.isNonUnique()) {
if (!index.isNonUnique()) {
index.setIndextype(IndexType.Unique);
} else {
index.setIndextype(IndexType.Normal);
Expand All @@ -183,7 +181,7 @@ private static TableMeta resultSetMetaToSchema(DatabaseMetaData dbmd, String tab
}

while (rsPrimary.next()) {
String pkIndexName = rsPrimary.getObject(6).toString();
String pkIndexName = rsPrimary.getString("PK_NAME");
if (tm.getAllIndexes().containsKey(pkIndexName)) {
IndexMeta index = tm.getAllIndexes().get(pkIndexName);
index.setIndextype(IndexType.PRIMARY);
Expand Down

0 comments on commit 7696cd8

Please sign in to comment.