[ 
https://issues.apache.org/jira/browse/CASSANDRA-10380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15235544#comment-15235544
 ] 

Vadim TSes'ko commented on CASSANDRA-10380:
-------------------------------------------

I managed to reproduce the bug using Cassandra 2.2.5.
The table schema is:
{code:sql}
CREATE TABLE my_table (
    u text,
    t timeuuid,
    PRIMARY KEY (u, t)
) WITH CLUSTERING ORDER BY (t DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = ''
    AND compaction = {'min_threshold': '2', 'class': 
'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy', 
'base_time_seconds': '1'}
    AND compression = {'sstable_compression': 
'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND dclocal_read_repair_chance = 0.0
    AND default_time_to_live = 10
    AND gc_grace_seconds = 0
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';
{code}
A query with wrong result:
{code:sql}
> select count(*) from my_table where u = 'user-0' limit 1;

 count
-------
     8

(1 rows)
{code}

> SELECT count within a partition does not respect LIMIT
> ------------------------------------------------------
>
>                 Key: CASSANDRA-10380
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10380
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Adam Holmberg
>            Assignee: Benjamin Lerer
>            Priority: Minor
>         Attachments: 10380.txt
>
>
> {code}
> cassandra@cqlsh> create KEYSPACE test WITH replication = {'class': 
> 'SimpleStrategy', 'replication_factor': '1'};
> cassandra@cqlsh> use test;
> cassandra@cqlsh:test> create table t (k int, c int, v int, primary key (k, 
> c));
> cassandra@cqlsh:test> INSERT INTO t (k, c, v) VALUES (0, 0, 0);
> cassandra@cqlsh:test> INSERT INTO t (k, c, v) VALUES (0, 1, 0);
> cassandra@cqlsh:test> INSERT INTO t (k, c, v) VALUES (0, 2, 0);
> cassandra@cqlsh:test> select * from t where k = 0;
>  k | c | v
> ---+---+---
>  0 | 0 | 0
>  0 | 1 | 0
>  0 | 2 | 0
> (3 rows)
> cassandra@cqlsh:test> select count(*) from t where k = 0 limit 2;
>  count
> -------
>      3
> (1 rows)
> {code}
> Expected: count should return 2, according to limit.
> Actual: count of all rows in partition
> This manifests in 3.0, does not appear in 2.2



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to