Updated Branches:
  refs/heads/trunk 0132b71a0 -> 972184bf7

Allow empty CQL3 batches as no-op

patch by slebresne; reviewed by iamaleksey for CASSANDRA-5994


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

Branch: refs/heads/trunk
Commit: 9b545caab5376e7f6e43aba49888df662a5d6e0d
Parents: fd12966
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Wed Sep 11 08:29:25 2013 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Wed Sep 11 08:29:25 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                              | 1 +
 src/java/org/apache/cassandra/cql3/Cql.g | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b545caa/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 12e2017..cfcb364 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,7 @@
  * Correctly handle limits in CompositesSearcher (CASSANDRA-5975)
  * Pig: handle CQL collections (CASSANDRA-5867)
  * Pass the updated cf to the PRSI index() method (CASSANDRA-5999)
+ * Allow empty CQL3 batches (as no-op) (CASSANDRA-5994)
 
 
 1.2.9

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b545caa/src/java/org/apache/cassandra/cql3/Cql.g
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g 
b/src/java/org/apache/cassandra/cql3/Cql.g
index f59be51..2445bf2 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -386,7 +386,7 @@ batchStatement returns [BatchStatement expr]
     : K_BEGIN
       ( K_UNLOGGED { type = BatchStatement.Type.UNLOGGED; } | K_COUNTER { type 
= BatchStatement.Type.COUNTER; } )?
       K_BATCH ( usingClause[attrs] )?
-          ( s=batchStatementObjective ';'? { statements.add(s); } )+
+          ( s=batchStatementObjective ';'? { statements.add(s); } )*
       K_APPLY K_BATCH
       {
           return new BatchStatement(type, statements, attrs);

Reply via email to