Skip to content

Commit 5a307dc

Browse files
committed
Test
1 parent 2d5145e commit 5a307dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/operation/JdbcTableOperations.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,11 @@ protected List<Index> getIndexes(Connection connection, String databaseName, Str
402402
ResultSet indexInfo = getIndexInfo(databaseName, tableName, metaData);
403403
while (indexInfo.next()) {
404404
String indexName = indexInfo.getString("INDEX_NAME");
405+
String loadedTableName = indexInfo.getString("TABLE_NAME");
405406
// The primary key is also the unique key, so we need to filter the primary key here.
406-
if (!indexInfo.getBoolean("NON_UNIQUE") && !primaryIndexNames.contains(indexName)) {
407+
if (loadedTableName.equals(tableName)
408+
&& !indexInfo.getBoolean("NON_UNIQUE")
409+
&& !primaryIndexNames.contains(indexName)) {
407410
jdbcIndexBeans.add(
408411
new JdbcIndexBean(
409412
Index.IndexType.UNIQUE_KEY,

0 commit comments

Comments
 (0)