cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/2] cassandra git commit: Fix paging of DISTINCT with static and IN
Date Sat, 19 Sep 2015 15:12:12 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk e44e21ce5 -> 1e669e562


Fix paging of DISTINCT with static and IN

patch by Sylvain Lebresne; reviewed by Blake Eggleston for
CASSANDRA-10354


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

Branch: refs/heads/trunk
Commit: 91e250146156eda8ef9f89a25b43184d4e49c1b4
Parents: 5a4253b
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Sep 16 16:41:25 2015 +0200
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Sat Sep 19 16:11:11 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 src/java/org/apache/cassandra/db/filter/DataLimits.java        | 3 +++
 .../apache/cassandra/service/pager/MultiPartitionPager.java    | 6 +++---
 3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/91e25014/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e589626..45fa773 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.0-rc1
+ * Fix paging of DISTINCT with static and IN (CASSANDRA-10354)
  * Allow MATERIALIZED VIEW's SELECT statement to restrict primary key
    columns (CASSANDRA-9664)
  * Move crc_check_chance out of compression options (CASSANDRA-9839)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/91e25014/src/java/org/apache/cassandra/db/filter/DataLimits.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/DataLimits.java b/src/java/org/apache/cassandra/db/filter/DataLimits.java
index 75c8290..d5eefe3 100644
--- a/src/java/org/apache/cassandra/db/filter/DataLimits.java
+++ b/src/java/org/apache/cassandra/db/filter/DataLimits.java
@@ -303,7 +303,10 @@ public abstract class DataLimits
                 // rows in the partition. However, if we only have the static row, it will
be returned as one row
                 // so count it.
                 if (hasLiveStaticRow && rowInCurrentPartition == 0)
+                {
                     ++rowCounted;
+                    ++rowInCurrentPartition;
+                }
             }
 
             public int counted()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/91e25014/src/java/org/apache/cassandra/service/pager/MultiPartitionPager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/pager/MultiPartitionPager.java b/src/java/org/apache/cassandra/service/pager/MultiPartitionPager.java
index ee2db9f..e826be6 100644
--- a/src/java/org/apache/cassandra/service/pager/MultiPartitionPager.java
+++ b/src/java/org/apache/cassandra/service/pager/MultiPartitionPager.java
@@ -169,13 +169,13 @@ public class MultiPartitionPager implements QueryPager
         {
             while (result == null || !result.hasNext())
             {
+                if (result != null)
+                    result.close();
+
                 // This sets us on the first non-exhausted pager
                 if (isExhausted())
                     return endOfData();
 
-                if (result != null)
-                    result.close();
-
                 int toQuery = pageSize - counter.counted();
                 result = consistency == null
                        ? pagers[current].fetchPageInternal(toQuery, orderGroup)


Mime
View raw message