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 2015/01/14 11:59:03 UTC
cassandra git commit: Minor fix for #8558
Repository: cassandra
Updated Branches:
refs/heads/cassandra-2.1 1c9c47d26 -> 0a17c0fd7
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/cassandra-2.1
Commit: 0a17c0fd7d31e6ff6ea4d4ae901ded72bb2fe113
Parents: 1c9c47d
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Jan 14 11:58:50 2015 +0100
Committer: Sylvain Lebresne <sy...@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)