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 2012/06/27 09:53:39 UTC

git commit: CQL3: fix range query containing unqueryed results

Updated Branches:
  refs/heads/cassandra-1.1 0627c8aae -> 54c647ffe


CQL3: fix range query containing unqueryed results

patch by slebresne; reviewed by jbellis for CASSANDRA-4372


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

Branch: refs/heads/cassandra-1.1
Commit: 54c647ffe07f51f6c237f33f7214898bdf8338bb
Parents: 0627c8a
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Jun 27 09:52:18 2012 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed Jun 27 09:52:18 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../cassandra/cql3/statements/SelectStatement.java |    8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54c647ff/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4c2b836..47f21b8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -19,6 +19,7 @@
  * Use CF comparator to sort indexed columns in SecondaryIndexManager
    (CASSANDRA-4365)
  * add strategy_options to the KSMetaData.toString() output (CASSANDRA-4248)
+ * (cql3) fix range queries containing unqueried results (CASSANDRA-4372)
 Merged from 1.0:
  * Set gc_grace on index CF to 0 (CASSANDRA-4314)
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54c647ff/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 600415e..2f121e3 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -495,7 +495,7 @@ public class SelectStatement implements CQLStatement
         ColumnNameBuilder builder = cfDef.getColumnNameBuilder();
         for (Restriction r : columnRestrictions)
         {
-            if (r == null)
+            if (r == null || (!r.isEquality() && r.bound(b) == null))
             {
                 // There wasn't any non EQ relation on that key, we select all records having the preceding component as prefix.
                 // For composites, if there was preceding component and we're computing the end, we must change the last component
@@ -514,10 +514,8 @@ public class SelectStatement implements CQLStatement
             else
             {
                 Term t = r.bound(b);
-                if (t == null)
-                    return ByteBufferUtil.EMPTY_BYTE_BUFFER;
-                else
-                    return builder.add(t, r.getRelation(b), variables).build();
+                assert t != null;
+                return builder.add(t, r.getRelation(b), variables).build();
             }
         }
         // Means no relation at all or everything was an equal