cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Avoid StackOverflow with large IN queries
Date Mon, 13 Jan 2014 09:24:56 GMT
Updated Branches:
  refs/heads/cassandra-1.2 1997b7b40 -> 34058783f


Avoid StackOverflow with large IN queries

patch by slebresne; reviewed by jbellis for CASSANDRA-6567


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

Branch: refs/heads/cassandra-1.2
Commit: 34058783f50b8c81096075b01d093e7aceec2b73
Parents: 1997b7b
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Jan 13 10:21:35 2014 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Jan 13 10:24:49 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../cassandra/cql3/statements/SelectStatement.java       | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/34058783/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cba97d0..25c105c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,7 @@
  * Validate CF existence on execution for prepared statement (CASSANDRA-6535)
  * Add ability to throttle batchlog replay (CASSANDRA-6550)
  * Fix executing LOCAL_QUORUM with SimpleStrategy (CASSANDRA-6545)
+ * Avoid StackOverflow when using large IN queries (CASSANDRA-6567)
 
 
 1.2.13

http://git-wip-us.apache.org/repos/asf/cassandra/blob/34058783/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 4730f18..001c77a 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -730,10 +730,13 @@ public class SelectStatement implements CQLStatement, MeasurableForPreparedCache
                     Iterator<ByteBuffer> iter = requested.iterator();
                     public IColumn computeNext()
                     {
-                        if (!iter.hasNext())
-                            return endOfData();
-                        IColumn column = cf.getColumn(iter.next());
-                        return column == null ? computeNext() : column;
+                        while (iter.hasNext())
+                        {
+                            IColumn column = cf.getColumn(iter.next());
+                            if (column != null)
+                                return column;
+                        }
+                        return endOfData();
                     }
                 };
             }


Mime
View raw message