From d564a2f02bcbfd850b51e9eea5297b79a4bd369c Mon Sep 17 00:00:00 2001 From: Sylvain Lebresne Date: Wed, 7 Nov 2012 19:32:38 +0100 Subject: [PATCH] Don't share slice query filter in SelectStatement patch by slebresne; reviewed by jbellis for CASSANDRA-4928 --- CHANGES.txt | 3 +++ .../apache/cassandra/cql3/statements/SelectStatement.java | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a84b3b0cc5..1544a7aa5f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +1.2-rc1 + * Don't share slice query filter in CQL3 SelectStatement (CASSANDRA-4928) + 1.2-beta2 * fp rate of 1.0 disables BF entirely; LCS defaults to 1.0 (CASSANDRA-4876) * off-heap bloom filters for row keys (CASSANDRA_4865) diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java index 945d2e8d12..44188de564 100644 --- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java @@ -202,7 +202,6 @@ public class SelectStatement implements CQLStatement Collection keys = getKeys(variables); List commands = new ArrayList(keys.size()); - IDiskAtomFilter filter = makeFilter(variables); // ...a range (slice) of column names if (isColumnRange()) { @@ -212,12 +211,17 @@ public class SelectStatement implements CQLStatement for (ByteBuffer key : keys) { QueryProcessor.validateKey(key); - commands.add(new SliceFromReadCommand(keyspace(), key, queryPath, (SliceQueryFilter)filter)); + // Note that we should not share the slice filter amongst the command, due to SliceQueryFilter not + // being immutable due to its columnCounter used by the lastCounted() method + // (this is fairly ugly and we should change that but that's probably not a tiny refactor to do that cleanly) + commands.add(new SliceFromReadCommand(keyspace(), key, queryPath, (SliceQueryFilter)makeFilter(variables))); } } // ...of a list of column names else { + // ByNames commands can share the filter + IDiskAtomFilter filter = makeFilter(variables); for (ByteBuffer key: keys) { QueryProcessor.validateKey(key);