cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [3/3] git commit: Fix overflow in SelectStatement.getLimit()
Date Wed, 21 Nov 2012 11:38:47 GMT
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/trunk
Commit: e39bf7a3df66a0062716632e6a3cd28ae1a633cb
Parents: b4f2f20
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Nov 21 12:38:00 2012 +0100
Committer: Sylvain Lebresne <sylvain@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


Mime
View raw message