Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 c95a7098c -> 96eb58a0f


Add a NEWS.txt entry about LIMIT behavior change and unit tests

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


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

Branch: refs/heads/cassandra-3.0
Commit: 96eb58a0fb6ac6dd4ba438120b2cd2725e815e95
Parents: c95a709
Author: blerer <benjamin.le...@datastax.com>
Authored: Tue Sep 22 20:44:49 2015 +0200
Committer: blerer <benjamin.le...@datastax.com>
Committed: Tue Sep 22 20:49:48 2015 +0200

----------------------------------------------------------------------
 NEWS.txt                                                         | 3 +++
 .../cassandra/cql3/validation/operations/AggregationTest.java    | 4 ++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/96eb58a0/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index 924c35f..67398cf 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -44,6 +44,9 @@ New features
 
 Upgrading
 ---------
+   - The LIMIT clause applies now only to the number of rows returned to the 
user,
+     not to the number of row queried. By consequence, queries using 
aggregates will not
+     be impacted by the LIMIT clause anymore.
    - The native protocol versions 1 and 2 are not supported anymore.
    - Max mutation size is now configurable via max_mutation_size_in_kb setting 
in
      cassandra.yaml; the default is half the size commitlog_segment_size_in_mb 
* 1024.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/96eb58a0/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java
----------------------------------------------------------------------
diff --git 
a/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java
 
b/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java
index a1d0aab..7b3f12c 100644
--- 
a/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java
+++ 
b/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java
@@ -91,6 +91,8 @@ public class AggregationTest extends CQLTester
         assertRows(execute("SELECT COUNT(*) FROM %s"), row(4L));
         assertRows(execute("SELECT COUNT(1) FROM %s"), row(4L));
         assertRows(execute("SELECT COUNT(b), count(c), count(e), count(f) FROM 
%s"), row(4L, 3L, 3L, 3L));
+        // Makes sure that LIMIT does not affect the result of aggregates
+        assertRows(execute("SELECT COUNT(b), count(c), count(e), count(f) FROM 
%s LIMIT 2"), row(4L, 3L, 3L, 3L));
     }
 
     @Test
@@ -130,6 +132,8 @@ public class AggregationTest extends CQLTester
         assertRows(execute("SELECT COUNT(1) FROM %s"), row(4L));
         assertRows(execute("SELECT max(b), b, COUNT(*) FROM %s"), row(5, 1, 
4L));
         assertRows(execute("SELECT max(b), COUNT(1), b FROM %s"), row(5, 4L, 
1));
+        // Makes sure that LIMIT does not affect the result of aggregates
+        assertRows(execute("SELECT max(b), COUNT(1), b FROM %s LIMIT 2"), 
row(5, 4L, 1));
     }
 
     @Test

Reply via email to