cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/6] cassandra git commit: Add regression test for CASSANDRA-11102
Date Tue, 02 Feb 2016 13:40:13 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 df3d0b00b -> bc3ea6692
  refs/heads/cassandra-3.3 8996b64e4 -> fddace61e
  refs/heads/trunk be1efd283 -> 9b629d0dc


Add regression test for CASSANDRA-11102


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

Branch: refs/heads/cassandra-3.0
Commit: bc3ea66925429b743b672d417700d17e9936b187
Parents: df3d0b0
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Feb 2 14:39:28 2016 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Tue Feb 2 14:39:28 2016 +0100

----------------------------------------------------------------------
 .../cql3/validation/operations/DeleteTest.java  | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/bc3ea669/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
index 4f35afa..be858e7 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
@@ -1008,6 +1008,35 @@ public class DeleteTest extends CQLTester
                              "DELETE FROM %s WHERE values CONTAINS ?", 3);
     }
 
+    @Test
+    public void testDeleteWithOnlyPK() throws Throwable
+    {
+        // This is a regression test for CASSANDRA-11102
+
+        createTable("CREATE TABLE %s (k int, v int, PRIMARY KEY (k, v)) WITH gc_grace_seconds=1");
+
+        execute("INSERT INTO %s(k, v) VALUES (?, ?)", 1, 2);
+
+        execute("DELETE FROM %s WHERE k = ? AND v = ?", 1, 2);
+        execute("INSERT INTO %s(k, v) VALUES (?, ?)", 2, 3);
+
+        Thread.sleep(500);
+
+        execute("DELETE FROM %s WHERE k = ? AND v = ?", 2, 3);
+        execute("INSERT INTO %s(k, v) VALUES (?, ?)", 1, 2);
+
+        Thread.sleep(500);
+
+        flush();
+
+        assertRows(execute("SELECT * FROM %s"), row(1, 2));
+
+        Thread.sleep(1000);
+        compact();
+
+        assertRows(execute("SELECT * FROM %s"), row(1, 2));
+    }
+
     private void flush(boolean forceFlush)
     {
         if (forceFlush)


Mime
View raw message