cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/4] cassandra git commit: Minor fix for #8558
Date Wed, 14 Jan 2015 13:17:55 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 0b723ce74 -> 7a4752843


Minor fix for #8558


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

Branch: refs/heads/trunk
Commit: 0a17c0fd7d31e6ff6ea4d4ae901ded72bb2fe113
Parents: 1c9c47d
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Jan 14 11:58:50 2015 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Jan 14 11:58:50 2015 +0100

----------------------------------------------------------------------
 .../org/apache/cassandra/cql3/statements/SelectStatement.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0a17c0fd/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 4ef554d..30259dd 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -844,7 +844,7 @@ public class SelectStatement implements CQLStatement
                 // For composites, if there was preceding component and we're computing the
end, we must change the last component
                 // End-Of-Component, otherwise we would be selecting only one record.
                 Composite prefix = builder.build();
-                return Collections.singletonList(!prefix.isEmpty() && eocBound ==
Bound.END ? prefix.end() : prefix.start());
+                return Collections.singletonList(eocBound == Bound.END ? prefix.end() : prefix.start());
             }
             if (r.isSlice())
             {
@@ -869,7 +869,7 @@ public class SelectStatement implements CQLStatement
                             throw new InvalidRequestException(String.format("Invalid null
clustering key part %s", def.name));
                         Composite prefix = builder.buildWith(val);
                         // See below for why this
-                        s.add((eocBound == Bound.END && builder.remainingCount()
> 0) ? prefix.end() : prefix.start());
+                        s.add(builder.remainingCount() == 0 ? prefix : (eocBound == Bound.END
? prefix.end() : prefix.start()));
                     }
                     return new ArrayList<>(s);
                 }
@@ -887,7 +887,7 @@ public class SelectStatement implements CQLStatement
         // case using the eoc would be bad, since for the random partitioner we have no guarantee
that
         // prefix.end() will sort after prefix (see #5240).
         Composite prefix = builder.build();
-        return Collections.singletonList(eocBound == Bound.END && builder.remainingCount()
> 0 ? prefix.end() : prefix.start());
+        return Collections.singletonList(builder.remainingCount() == 0 ? prefix : (eocBound
== Bound.END ? prefix.end() : prefix.start()));
     }
 
     private static Composite.EOC eocForRelation(Operator op)


Mime
View raw message