cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [3/5] cassandra git commit: Merge branch cassandra-2.1 into cassandra-2.2
Date Wed, 09 Sep 2015 20:23:34 GMT
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/trunk
Commit: ec4b4d4467a90a50c645a26b5a7817f3c4d25cf4
Parents: 7b083a4 2106542
Author: blerer <benjamin.lerer@datastax.com>
Authored: Wed Sep 9 22:05:42 2015 +0200
Committer: blerer <benjamin.lerer@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)));
+     }
+ 
  }


Mime
View raw message