You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2016/02/08 12:40:11 UTC

[2/3] cassandra git commit: Additional test for CASSANDRA-11102

Additional 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/58821cef
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/58821cef
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/58821cef

Branch: refs/heads/trunk
Commit: 58821cefb2cc2b1bed0d28533dddea0323ecf487
Parents: d4fc9d0
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Mon Feb 8 12:37:46 2016 +0100
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Mon Feb 8 12:38:51 2016 +0100

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/58821cef/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 be858e7..da0bc33 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/DeleteTest.java
@@ -1037,6 +1037,27 @@ public class DeleteTest extends CQLTester
         assertRows(execute("SELECT * FROM %s"), row(1, 2));
     }
 
+    @Test
+    public void testDeleteColumnNoClustering() throws Throwable
+    {
+        // This is a regression test for CASSANDRA-11068 (and ultimately another test for CASSANDRA-11102)
+        // Creates a table without clustering, insert a row (with a column) and only remove the column.
+        // We should still have a row (with a null column value) even post-compaction.
+
+        createTable("CREATE TABLE %s (k int PRIMARY KEY, v int) WITH gc_grace_seconds=0");
+
+        execute("INSERT INTO %s(k, v) VALUES (?, ?)", 0, 0);
+        execute("DELETE v FROM %s WHERE k=?", 0);
+
+        assertRows(execute("SELECT * FROM %s"), row(0, null));
+
+        flush();
+        assertRows(execute("SELECT * FROM %s"), row(0, null));
+
+        compact();
+        assertRows(execute("SELECT * FROM %s"), row(0, null));
+    }
+
     private void flush(boolean forceFlush)
     {
         if (forceFlush)