diff --git a/CHANGES.txt b/CHANGES.txt index cee28bc21a..c3e84db6e0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,8 @@ 2.0.16: + * Push correct protocol notification for DROP INDEX (CASSANDRA-9310) * token-generator - generated tokens too long (CASSANDRA-9300) + 2.0.15: * Fix counting of tombstones for TombstoneOverwhelmingException (CASSANDRA-9299) * Fix ReconnectableSnitch reconnecting to peers during upgrade (CASSANDRA-6702) diff --git a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java index b2e8dde058..c421c096f8 100644 --- a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java @@ -33,6 +33,9 @@ public class DropIndexStatement extends SchemaAlteringStatement public final String indexName; public final boolean ifExists; + // initialized in announceMigration() + private String indexedCF; + public DropIndexStatement(String indexName, boolean ifExists) { super(new CFName()); @@ -40,14 +43,20 @@ public class DropIndexStatement extends SchemaAlteringStatement this.ifExists = ifExists; } - // We don't override CFStatement#columnFamily as this'd change the - // protocol for returned events when we drop an index. We need it - // to return null so that SchemaMigrations remain a keyspace, - // rather than table, level event (see SchemaAlteringStatement#execute). - public String getColumnFamily() throws InvalidRequestException + public String columnFamily() { - CFMetaData cfm = findIndexedCF(); - return cfm == null ? null : cfm.cfName; + if (indexedCF != null) + return indexedCF; + + try + { + CFMetaData cfm = findIndexedCF(); + return cfm == null ? null : cfm.cfName; + } + catch (InvalidRequestException ire) + { + throw new RuntimeException(ire); + } } public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException @@ -77,6 +86,7 @@ public class DropIndexStatement extends SchemaAlteringStatement return false; CFMetaData updatedCfm = updateCFMetadata(cfm); + indexedCF = updatedCfm.cfName; MigrationManager.announceColumnFamilyUpdate(updatedCfm, false); return true; }