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/11/21 12:38:31 UTC

[2/2] git commit: Fix overflow in SelectStatement.getLimit()

Fix overflow in SelectStatement.getLimit()


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

Branch: refs/heads/cassandra-1.2
Commit: e39bf7a3df66a0062716632e6a3cd28ae1a633cb
Parents: b4f2f20
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Wed Nov 21 12:38:00 2012 +0100
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Wed Nov 21 12:38:00 2012 +0100

----------------------------------------------------------------------
 .../cassandra/cql3/statements/SelectStatement.java |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e39bf7a3/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 44188de..5963e0e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -328,7 +328,9 @@ public class SelectStatement implements CQLStatement
     {
         // Internally, we don't support exclusive bounds for slices. Instead,
         // we query one more element if necessary and exclude
-        return sliceRestriction != null && !sliceRestriction.isInclusive(Bound.START) ? parameters.limit + 1 : parameters.limit;
+        return sliceRestriction != null && !sliceRestriction.isInclusive(Bound.START) && parameters.limit != Integer.MAX_VALUE
+             ? parameters.limit + 1
+             : parameters.limit;
     }
 
     private Collection<ByteBuffer> getKeys(final List<ByteBuffer> variables) throws InvalidRequestException