diff --git a/CHANGES.txt b/CHANGES.txt index c03cc360eb..684d003d80 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -81,10 +81,6 @@ Merged from 2.0: * Use LOCAL_QUORUM for data reads at LOCAL_SERIAL (CASSANDRA-6939) * Log a warning for large batches (CASSANDRA-6487) * Put nodes in hibernate when join_ring is false (CASSANDRA-6961) - * Continue assassinating even if the endpoint vanishes (CASSANDRA-6787) - * Non-droppable verbs shouldn't be dropped from OTC (CASSANDRA-6980) - * Shutdown batchlog executor in SS#drain() (CASSANDRA-7025) - * Schedule schema pulls on change (CASSANDRA-6971) * Avoid early loading of non-system keyspaces before compaction-leftovers cleanup at startup (CASSANDRA-6913) * Restrict Windows to parallel repairs (CASSANDRA-6907) diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java index 95d504dac9..a7d06dfee0 100644 --- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java @@ -104,9 +104,18 @@ public class BatchStatement implements CQLStatement, MeasurableForPreparedCache if (attrs.isTimeToLiveSet()) throw new InvalidRequestException("Global TTL on the BATCH statement is not supported."); + boolean timestampSet = attrs.isTimestampSet(); + if (timestampSet) + { + if (hasConditions) + throw new InvalidRequestException("Cannot provide custom timestamp for conditional BATCH"); + if (type == Type.COUNTER) + throw new InvalidRequestException("Cannot provide custom timestamp for counter BATCH"); + } + for (ModificationStatement statement : statements) { - if (attrs.isTimestampSet() && statement.isTimestampSet()) + if (timestampSet && statement.isTimestampSet()) throw new InvalidRequestException("Timestamp must be set either on BATCH or individual statements"); } }