cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject cassandra git commit: Fix Select * is only returning the first page of data
Date Mon, 10 Aug 2015 13:12:13 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 6e1e33696 -> e98be186d


Fix Select * is only returning the first page of data

patch by Benjamin Lerer; reviewed by Stefania Alborghetti for CASSANDRA-9913


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

Branch: refs/heads/cassandra-3.0
Commit: e98be186d1e39c45aa34e6ea995f0bf718b99015
Parents: 6e1e336
Author: blerer <benjamin.lerer@datastax.com>
Authored: Mon Aug 10 15:09:03 2015 +0200
Committer: blerer <benjamin.lerer@datastax.com>
Committed: Mon Aug 10 15:09:03 2015 +0200

----------------------------------------------------------------------
 .../cassandra/cql3/restrictions/StatementRestrictions.java    | 4 +++-
 .../org/apache/cassandra/cql3/statements/SelectStatement.java | 7 ++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e98be186/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
index 2bcd1f2..1a3b083 100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java
@@ -513,8 +513,10 @@ public final class StatementRestrictions
      */
     public boolean isColumnRange()
     {
+        // For static compact tables we need to ignore the fake clustering column.
+        int numberOfClusteringColumns = cfm.isStaticCompactTable() ? 0 : cfm.clusteringColumns().size();
         // it is a range query if it has at least one the column alias for which no relation
is defined or is not EQ.
-        return clusteringColumnsRestrictions.size() < cfm.clusteringColumns().size()
+        return clusteringColumnsRestrictions.size() < numberOfClusteringColumns
             || (!clusteringColumnsRestrictions.isEQ() && !clusteringColumnsRestrictions.isIN());
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e98be186/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 9ac76d6..d08c56f 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -337,7 +337,12 @@ public class SelectStatement implements CQLStatement
             try (PartitionIterator iter = pager.fetchPage(pageSize))
             {
                 while (iter.hasNext())
-                    processPartition(iter.next(), options, result, nowInSec);
+                {
+                    try (RowIterator partition = iter.next())
+                    {
+                        processPartition(partition, options, result, nowInSec);
+                    }
+                }
             }
         }
         return new ResultMessage.Rows(result.build(options.getProtocolVersion()));


Mime
View raw message