[jira] [Updated] (CASSANDRA-10955) Multi-partitions queries with ORDER BY can result in a NPE

2016-01-20 Thread Sam Tunnicliffe (JIRA)

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

Sam Tunnicliffe updated CASSANDRA-10955:

Reviewer: Sam Tunnicliffe

> Multi-partitions queries with ORDER BY can result in a NPE
> --
>
> Key: CASSANDRA-10955
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10955
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: Benjamin Lerer
>Assignee: Benjamin Lerer
> Attachments: 10955-2.2.txt
>
>
> In the case of a table with static columns, if only the static columns have 
> been set for some partitions, a multi-partitions query with an {{ORDER BY}} 
> can cause a {{NPE}}.
> The following unit test can be used to reproduce the problem:
> {code}
> @Test
> public void testOrderByForInClauseWithNullValue() throws Throwable
> {
> createTable("CREATE TABLE %s (a int, b int, c int, s int static, d 
> int, PRIMARY KEY (a, b, c))");
> execute("INSERT INTO %s (a, b, c, d) VALUES (1, 1, 1, 1)");
> execute("INSERT INTO %s (a, b, c, d) VALUES (1, 1, 2, 1)");
> execute("INSERT INTO %s (a, b, c, d) VALUES (2, 2, 1, 1)");
> execute("INSERT INTO %s (a, b, c, d) VALUES (2, 2, 2, 1)");
> execute("UPDATE %s SET s = 1 WHERE a = 1");
> execute("UPDATE %s SET s = 2 WHERE a = 2");
> execute("UPDATE %s SET s = 3 WHERE a = 3");
> assertRows(execute("SELECT a, b, c, d, s FROM %s WHERE a IN (1, 2, 3) 
> ORDER BY b DESC"),
>row(2, 2, 2, 1, 2),
>row(2, 2, 1, 1, 2),
>row(1, 1, 2, 1, 1),
>row(1, 1, 1, 1, 1),
>row(3, null, null, null, 3));
> }
> {code} 



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


[jira] [Updated] (CASSANDRA-10955) Multi-partitions queries with ORDER BY can result in a NPE

2016-01-15 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-10955:
---
Attachment: 10955-2.2.txt

The patch makes sure that we handle {{null}} values in the comparators used to 
sort the results.

||utests||dtests||
|[2.2|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-10955-2.2-testall/lastCompletedBuild/testReport/]|[2.2|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-10955-2.2-dtest/lastCompletedBuild/testReport/]|
|[3.0|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-10955-3.0-testall/lastCompletedBuild/testReport/]|[3.0|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-10955-3.0-dtest/lastCompletedBuild/testReport/]|

> Multi-partitions queries with ORDER BY can result in a NPE
> --
>
> Key: CASSANDRA-10955
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10955
> Project: Cassandra
>  Issue Type: Bug
>  Components: CQL
>Reporter: Benjamin Lerer
>Assignee: Benjamin Lerer
> Attachments: 10955-2.2.txt
>
>
> In the case of a table with static columns, if only the static columns have 
> been set for some partitions, a multi-partitions query with an {{ORDER BY}} 
> can cause a {{NPE}}.
> The following unit test can be used to reproduce the problem:
> {code}
> @Test
> public void testOrderByForInClauseWithNullValue() throws Throwable
> {
> createTable("CREATE TABLE %s (a int, b int, c int, s int static, d 
> int, PRIMARY KEY (a, b, c))");
> execute("INSERT INTO %s (a, b, c, d) VALUES (1, 1, 1, 1)");
> execute("INSERT INTO %s (a, b, c, d) VALUES (1, 1, 2, 1)");
> execute("INSERT INTO %s (a, b, c, d) VALUES (2, 2, 1, 1)");
> execute("INSERT INTO %s (a, b, c, d) VALUES (2, 2, 2, 1)");
> execute("UPDATE %s SET s = 1 WHERE a = 1");
> execute("UPDATE %s SET s = 2 WHERE a = 2");
> execute("UPDATE %s SET s = 3 WHERE a = 3");
> assertRows(execute("SELECT a, b, c, d, s FROM %s WHERE a IN (1, 2, 3) 
> ORDER BY b DESC"),
>row(2, 2, 2, 1, 2),
>row(2, 2, 1, 1, 2),
>row(1, 1, 2, 1, 1),
>row(1, 1, 1, 1, 1),
>row(3, null, null, null, 3));
> }
> {code} 



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