diff --git a/CHANGES.txt b/CHANGES.txt index f72929f196..0d80a8dd13 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ * Provide additional metrics for materialized views (CASSANDRA-10323) * Flush system schema tables after local schema changes (CASSANDRA-10429) Merged from 2.2: + * Fix the regression when using LIMIT with aggregates (CASSANDRA-10487) * Avoid NoClassDefFoundError during DataDescriptor initialization on windows (CASSANDRA-10412) * Preserve case of quoted Role & User names (CASSANDRA-10394) * cqlsh pg-style-strings broken (CASSANDRA-10484) diff --git a/NEWS.txt b/NEWS.txt index 1f320015ac..61fb9ba4c3 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -49,9 +49,6 @@ Upgrading older versions is not supported. - The 'memtable_allocation_type: offheap_objects' option has been removed. It should be re-introduced in a future release and you can follow CASSANDRA-9472 to know more. - - 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. @@ -160,6 +157,9 @@ New features New features ------------ + - 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. - Very large batches will now be rejected (defaults to 50kb). This can be customized by modifying batch_size_fail_threshold_in_kb. - Selecting columns,scalar functions, UDT fields, writetime or ttl together 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 7b3f12ce35..dc47861a0d 100644 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/operations/AggregationTest.java @@ -93,6 +93,8 @@ public class AggregationTest extends CQLTester 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)); + assertRows(execute("SELECT COUNT(b), count(c), count(e), count(f) FROM %s WHERE a = 1 LIMIT 2"), + row(4L, 3L, 3L, 3L)); } @Test @@ -134,6 +136,7 @@ public class AggregationTest extends CQLTester 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)); + assertRows(execute("SELECT max(b), COUNT(1), b FROM %s WHERE a = 1 LIMIT 2"), row(5, 4L, 1)); } @Test