[ 
https://issues.apache.org/jira/browse/CASSANDRA-10729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Lerer updated CASSANDRA-10729:
---------------------------------------
    Attachment: 10729-3.0.txt

The patch makes sure that we do not use any limit in paging when we do post 
sorting and trim the results once they are sorted.

||unit tests || dtests ||
|[10729-3.0|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-10729-3.0-testall/1/]|
 
[10729-3.0|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-10729-3.0-dtest/1/]|

> SELECT statement with IN restrictions on partition key + ORDER BY + LIMIT 
> return wrong results
> ----------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10729
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10729
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>             Fix For: 3.0.1, 3.1, 3.2
>
>         Attachments: 10729-3.0.txt
>
>
> If we execute a request with paging turned off, an IN restriction on the 
> partition key, ORDER BY and LIMIT the result returned are not the expected 
> ones.
> The following test can be used to reproduce the problem.
> {code}
>         createTable("CREATE TABLE %s (pk1 int, pk2 int, c int, v text, 
> PRIMARY KEY ((pk1, pk2), c) )");
>         execute("INSERT INTO %s (pk1, pk2, c, v) VALUES (?, ?, ?, ?)", 1, 1, 
> 2, "A");
>         execute("INSERT INTO %s (pk1, pk2, c, v) VALUES (?, ?, ?, ?)", 1, 2, 
> 1, "B");
>         execute("INSERT INTO %s (pk1, pk2, c, v) VALUES (?, ?, ?, ?)", 1, 3, 
> 3, "C");
>         execute("INSERT INTO %s (pk1, pk2, c, v) VALUES (?, ?, ?, ?)", 1, 1, 
> 4, "D");
>         assertRows(execute("SELECT v as c FROM %s where pk1 = ? AND pk2 IN 
> (?, ?) ORDER BY c; ", 1, 1, 2),
>                    row("B"),
>                    row("A"),
>                    row("D"));
>         assertRows(execute("SELECT v as c FROM %s where pk1 = ? AND pk2 IN 
> (?, ?) ORDER BY c LIMIT 2; ", 1, 1, 2),
>                    row("B"),
>                    row("A"));
> {code}



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

Reply via email to