You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benjamin Lerer (JIRA)" <ji...@apache.org> on 2016/01/15 11:51:39 UTC
[jira] [Commented] (CASSANDRA-10955) Multi-partitions queries with
ORDER BY can result in a NPE
[ https://issues.apache.org/jira/browse/CASSANDRA-10955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15101617#comment-15101617 ]
Benjamin Lerer commented on CASSANDRA-10955:
--------------------------------------------
[~beobal] could you review?
> 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)