cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Fix prepared BATCH statements with batch-level timestamps
Date Mon, 08 Apr 2013 12:48:49 GMT
Updated Branches:
  refs/heads/cassandra-1.2 69f05a704 -> 1429c54b0


Fix prepared BATCH statements with batch-level timestamps

patch by Aleksey Yeschenko; reviewed by Sylvain Lebresne for
CASSANDRA-5415


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1429c54b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1429c54b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1429c54b

Branch: refs/heads/cassandra-1.2
Commit: 1429c54b01f6116ecb95f33f6c656e9d1f310137
Parents: 69f05a7
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Mon Apr 8 15:46:58 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Mon Apr 8 15:46:58 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../cassandra/cql3/statements/BatchStatement.java  |    5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1429c54b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 12f38b6..5347f91 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -30,6 +30,7 @@
  * Add null syntax support in CQL3 for inserts (CASSANDRA-3783)
  * Allow unauthenticated set_keyspace() calls (CASSANDRA-5423)
  * Fix potential incremental backups race (CASSANDRA-5410)
+ * Fix prepared BATCH statements with batch-level timestamps (CASSANDRA-5415)
 Merged from 1.1:
  * cli: Quote ks and cf names in schema output when needed (CASSANDRA-5052)
  * Fix bad default for min/max timestamp in SSTableMetadata (CASSANDRA-5372)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1429c54b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index 6200237..f93eb63 100644
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@ -95,11 +95,8 @@ public class BatchStatement extends ModificationStatement
         Map<Pair<String, ByteBuffer>, IMutation> mutations = new HashMap<Pair<String,
ByteBuffer>, IMutation>();
         for (ModificationStatement statement : statements)
         {
-            if (isSetTimestamp())
-                statement.setTimestamp(getTimestamp(now));
-
             // Group mutation together, otherwise they won't get applied atomically
-            for (IMutation m : statement.getMutations(variables, local, cl, now))
+            for (IMutation m : statement.getMutations(variables, local, cl, getTimestamp(now)))
             {
                 if (m instanceof CounterMutation && type != Type.COUNTER)
                     throw new InvalidRequestException("Counter mutations are only allowed
in COUNTER batches");


Mime
View raw message