[
https://issues.apache.org/jira/browse/CASSANDRA-8105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Stupp updated CASSANDRA-8105:
------------------------------------
Attachment: 8105.txt
trivial fix for this
> NPE for null embedded UDT inside set
> ------------------------------------
>
> Key: CASSANDRA-8105
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8105
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Reporter: Andy Ketskes
> Labels: cql
> Fix For: 2.1.1
>
> Attachments: 8105.txt
>
>
> An NPE is thrown parsing an INSERT statement when a embedded UDT inside
> another UDT is set to null inside a set.
> This sounds very convoluted, but the examples below will hopefully make it
> clear...
> With the following definitions:
> CREATE TYPE ut1 (a int, b int);
> CREATE TYPE ut2 (j frozen<ut1>, k int);
> CREATE TYPE ut3 (i int, j frozen<ut1>);
> CREATE TABLE tab1 (x int PRIMARY KEY, y set<frozen<ut2>>);
> CREATE TABLE tab2 (x int PRIMARY KEY, y list<frozen<ut2>>);
> CREATE TABLE tab3 (x int PRIMARY KEY, y set<frozen<ut3>>);
> This query throws a NullPointerException:
> INSERT INTO tab1 (x, y) VALUES (1, { { k: 1 } });
> These however doesn't:
> INSERT INTO tab2 (x, y) VALUES (1, [ { k: 1 } ]);
> INSERT INTO tab3 (x, y) VALUES (1, { { i: 1 } });
> So, the bug seems to be triggered only when the UDT is in a set, lists are
> fine. If the embedded UDT is after the value specified in the query, the bug
> doesn't seem to trigger.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)