return;
}
txnService.beginTransaction(session);
try {
final Table table = getTable(session, tableName);
Collection<Index> tableIndexes = new HashSet<>();
Collection<Index> allIndexes = tableIndexes;
for(String indexName : indexNamesToDrop) {
Index index = table.getIndex(indexName);
if(index != null) {
tableIndexes.add(index);
}
else if ((index = table.getFullTextIndex(indexName)) != null) {
if (allIndexes == tableIndexes) {
allIndexes = new HashSet<>(allIndexes);
}
}
else {
throw new NoSuchIndexException(indexName);
}
// no primary key nor connected to a FK
if(index.isPrimaryKey() || index.isConnectedToFK()) {
throw new ProtectedIndexException(indexName, table.getName());
}
if (allIndexes != tableIndexes) {
allIndexes.add(index);
}
}