Repository: cassandra
Updated Branches:
  refs/heads/trunk 40b9e2cc2 -> 9e1437c14


Fix paging for IN queries on tables without clustering columns

patch by Benjamin Lerer; reviewed by Sylvain Lebresne for CASSANDRA-11208


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

Branch: refs/heads/trunk
Commit: 60b23b1252e600189d11c614d971a4c2c3055edc
Parents: 7a5f8b1
Author: Benjamin Lerer <[email protected]>
Authored: Thu Mar 10 11:50:03 2016 +0100
Committer: Benjamin Lerer <[email protected]>
Committed: Thu Mar 10 11:50:03 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 .../apache/cassandra/service/pager/AbstractQueryPager.java    | 7 +++++--
 src/java/org/apache/cassandra/service/pager/PagingState.java  | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/60b23b12/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5efb1b0..864a33d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.5
+ * Fix paging for IN queries on tables without clustering columns 
(CASSANDRA-11208)
  * Remove recursive call from CompositesSearcher (CASSANDRA-11304)
  * Fix filtering on non-primary key columns for queries without index 
(CASSANDRA-6377)
  * Fix sstableloader fail when using materialized view (CASSANDRA-11275)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/60b23b12/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java 
b/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
index 2599b8d..48f6c04 100644
--- a/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
+++ b/src/java/org/apache/cassandra/service/pager/AbstractQueryPager.java
@@ -124,8 +124,11 @@ abstract class AbstractQueryPager implements QueryPager
             int counted = counter.counted();
             remaining -= counted;
             // If the clustering of the last row returned is a static one, it 
means that the partition was only
-            // containing data within the static columns. Therefore, there are 
not data remaining within the partition.
-            if (lastRow != null && lastRow.clustering() == 
Clustering.STATIC_CLUSTERING)
+            // containing data within the static columns. If the clustering of 
the last row returned is empty
+            // it means that there is only one row per partition. Therefore, 
in both cases there are no data remaining
+            // within the partition.
+            if (lastRow != null && (lastRow.clustering() == 
Clustering.STATIC_CLUSTERING
+                    || lastRow.clustering() == Clustering.EMPTY))
             {
                 remainingInPartition = 0;
             }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/60b23b12/src/java/org/apache/cassandra/service/pager/PagingState.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/PagingState.java 
b/src/java/org/apache/cassandra/service/pager/PagingState.java
index d495f9d..611523f 100644
--- a/src/java/org/apache/cassandra/service/pager/PagingState.java
+++ b/src/java/org/apache/cassandra/service/pager/PagingState.java
@@ -162,7 +162,7 @@ public class PagingState
     public String toString()
     {
         return String.format("PagingState(key=%s, cellname=%s, remaining=%d, 
remainingInPartition=%d",
-                             ByteBufferUtil.bytesToHex(partitionKey),
+                             partitionKey != null ? 
ByteBufferUtil.bytesToHex(partitionKey) : null,
                              rowMark,
                              remaining,
                              remainingInPartition);

Reply via email to