diff --git a/CHANGES.txt b/CHANGES.txt index 487f388ae2..8c58af77c6 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) diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java index d7089f9b69..26f082bfdd 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)); + } } } }