Skip to content

Commit

Permalink
DBZ-5300 Exclude ADT indices as relational primary keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros authored and jpechane committed Jun 27, 2022
1 parent 5d4d659 commit cfc6377
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -50,6 +50,11 @@ public class OracleConnection extends JdbcConnection {
*/
private static final Pattern SYS_NC_PATTERN = Pattern.compile("^SYS_NC(?:_OID|_ROWINFO|[0-9][0-9][0-9][0-9][0-9])\\$$");

/**
* Pattern to identify abstract data type indices and column names.
*/
private static final Pattern ADT_INDEX_NAMES_PATTERN = Pattern.compile("^\".*\"\\.\".*\".*");

/**
* A field for the raw jdbc url. This field has no default value.
*/
Expand Down Expand Up @@ -223,7 +228,7 @@ public List<String> readTableUniqueIndices(DatabaseMetaData metadata, TableId id
@Override
protected boolean isTableUniqueIndexIncluded(String indexName, String columnName) {
if (columnName != null) {
return !SYS_NC_PATTERN.matcher(columnName).matches();
return !SYS_NC_PATTERN.matcher(columnName).matches() && !ADT_INDEX_NAMES_PATTERN.matcher(columnName).matches();
}
return false;
}
Expand Down

0 comments on commit cfc6377

Please sign in to comment.