You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2015/09/09 22:21:58 UTC

[3/4] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2

Merge branch cassandra-2.1 into cassandra-2.2


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

Branch: refs/heads/cassandra-3.0
Commit: ec4b4d4467a90a50c645a26b5a7817f3c4d25cf4
Parents: 7b083a4 2106542
Author: blerer <be...@datastax.com>
Authored: Wed Sep 9 22:05:42 2015 +0200
Committer: blerer <be...@datastax.com>
Committed: Wed Sep 9 22:11:58 2015 +0200

----------------------------------------------------------------------
 .../cql3/statements/ModificationStatement.java  |  5 ++++-
 .../validation/entities/CollectionsTest.java    | 22 ++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec4b4d44/src/java/org/apache/cassandra/cql3/statements/ModificationStatement.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec4b4d44/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java
index 2e72c39,31dd5a6..6266fe7
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/CollectionsTest.java
@@@ -585,4 -485,27 +585,26 @@@ public class CollectionsTest extends CQ
          assertInvalid("alter table %s add v set<int>");
      }
  
 -
+     /**
+      * Test for 9838.
+      */
+     @Test
+     public void testUpdateStaticList() throws Throwable
+     {
+         createTable("CREATE TABLE %s (k1 text, k2 text, s_list list<int> static, PRIMARY KEY (k1, k2))");
+ 
+         execute("insert into %s (k1, k2) VALUES ('a','b')");
+         execute("update %s set s_list = s_list + [0] where k1='a'");
+         assertRows(execute("select s_list from %s where k1='a'"), row(list(0)));
+ 
+         execute("update %s set s_list[0] = 100 where k1='a'");
+         assertRows(execute("select s_list from %s where k1='a'"), row(list(100)));
+ 
+         execute("update %s set s_list = s_list + [0] where k1='a'");
+         assertRows(execute("select s_list from %s where k1='a'"), row(list(100, 0)));
+ 
+         execute("delete s_list[0] from %s where k1='a'");
+         assertRows(execute("select s_list from %s where k1='a'"), row(list(0)));
+     }
+ 
  }