From 7bbeb5aa2d1064281589b98306f950550bd47e60 Mon Sep 17 00:00:00 2001 From: Sylvain Lebresne Date: Thu, 29 May 2014 12:48:06 +0200 Subject: [PATCH] Fix bug with some IN queries missing results patch by slebresne; reviewed by thobbs for CASSANDRA-7105 --- CHANGES.txt | 1 + .../org/apache/cassandra/cql3/statements/SelectStatement.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index e7d7028a1b..619c219c17 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,6 +24,7 @@ * raise streaming phi convict threshold level (CASSANDRA-7063) * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191) * exit CQLSH with error status code if script fails (CASSANDRA-6344) + * Fix bug with some IN queries missig results (CASSANDRA-7105) 1.2.16 diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java index e058cff14e..02833e7bbc 100644 --- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java @@ -626,7 +626,7 @@ public class SelectStatement implements CQLStatement, MeasurableForPreparedCache throw new InvalidRequestException(String.format("Invalid null clustering key part %s", name)); ColumnNameBuilder copy = builder.copy().add(val); // See below for why this - s.add((b == Bound.END && copy.remainingCount() > 0) ? copy.buildAsEndOfRange() : copy.build()); + s.add((eocBound == Bound.END && copy.remainingCount() > 0) ? copy.buildAsEndOfRange() : copy.build()); } return new ArrayList(s); } @@ -652,7 +652,7 @@ public class SelectStatement implements CQLStatement, MeasurableForPreparedCache // with 2ndary index is done, and with the the partition provided with an EQ, we'll end up here, and in that // case using the eoc would be bad, since for the random partitioner we have no guarantee that // builder.buildAsEndOfRange() will sort after builder.build() (see #5240). - return Collections.singletonList((bound == Bound.END && builder.remainingCount() > 0) ? builder.buildAsEndOfRange() : builder.build()); + return Collections.singletonList((eocBound == Bound.END && builder.remainingCount() > 0) ? builder.buildAsEndOfRange() : builder.build()); } private List getRequestedBound(Bound b, List variables) throws InvalidRequestException