Repository: cassandra Updated Branches: refs/heads/cassandra-3.0 d4fc9d0b0 -> 58821cefb refs/heads/trunk d3f0c32f0 -> 696cd9117
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/cassandra-3.0 Commit: 58821cefb2cc2b1bed0d28533dddea0323ecf487 Parents: d4fc9d0 Author: Sylvain Lebresne <sylv...@datastax.com> Authored: Mon Feb 8 12:37:46 2016 +0100 Committer: Sylvain Lebresne <sylv...@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)