Updated Branches:
  refs/heads/cassandra-1.1 a4f06c237 -> cbf043618

Fix range queries with secondary indexes

patch by slebresne; reviewed by xedin for CASSANDRA-4257


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

Branch: refs/heads/cassandra-1.1
Commit: cbf0436181fe1f47eff98f54aa161dd5fbca0479
Parents: f77cd11
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Thu May 24 16:44:32 2012 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu May 24 16:44:32 2012 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbf04361/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 487f388..8c58af7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -62,6 +62,7 @@
  * Fix exception on colum metadata with non-string comparator (CASSANDRA-4269)
  * Check for unknown/invalid compression options (CASSANDRA-4266)
  * (cql3) Adds simple access to column timestamp and ttl (CASSANDRA-4217)
+ * (cql3) Fix range queries with secondary indexes (CASSANDRA-4257)
 Merged from 1.0:
  * Fix super columns bug where cache is not updated (CASSANDRA-4190)
  * fix maxTimestamp to include row tombstones (CASSANDRA-4116)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbf04361/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 d7089f9..26f082b 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -546,8 +546,11 @@ public class SelectStatement implements CQLStatement
             {
                 for (Bound b : Bound.values())
                 {
-                    ByteBuffer value = 
restriction.bound(b).getByteBuffer(name.type, variables);
-                    expressions.add(new IndexExpression(name.name.key, 
restriction.getIndexOperator(b), value));
+                    if (restriction.bound(b) != null)
+                    {
+                        ByteBuffer value = 
restriction.bound(b).getByteBuffer(name.type, variables);
+                        expressions.add(new IndexExpression(name.name.key, 
restriction.getIndexOperator(b), value));
+                    }
                 }
             }
         }

Reply via email to