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

Brandon Williams updated CASSANDRA-21738:
-----------------------------------------
     Bug Category: Parent values: Availability(12983)Level 1 values: Response 
Crash(12991)
       Complexity: Normal
      Component/s: CQL/Semantics
    Discovered By: User Report
    Fix Version/s: 5.0.x
                   6.x
                   7.x
         Severity: Normal
           Status: Open  (was: Triage Needed)

> NullPointerException when an empty value is bound to USING TIMESTAMP
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-21738
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21738
>             Project: Apache Cassandra
>          Issue Type: Bug
>          Components: CQL/Semantics
>            Reporter: Nadav Har'El
>            Priority: Normal
>             Fix For: 5.0.x, 6.x, 7.x
>
>
> When a prepared statement's {{USING TIMESTAMP ?}} bind marker is given an 
> empty (zero-length) value, the request fails with a server error caused by a 
> NullPointerException:
> {code:sql}
> CREATE TABLE ks.t (k int PRIMARY KEY, v int);
> -- prepare, and bind ? to an empty (0-byte) value:
> INSERT INTO ks.t (k, v) VALUES (1, 1) USING TIMESTAMP ?;
> {code}
> {noformat}
> Server error: java.lang.NullPointerException: Cannot invoke 
> "java.lang.Long.longValue()" because the return value of ... is null
> {noformat}
> Reproduced on Cassandra 5.0.9 and 6.0-alpha2.
> CASSANDRA-17822 fixed the same NPE for {{USING TTL ?}}: 
> {{Attributes.getTimeToLive()}} now treats an empty value like null, i.e. no 
> TTL ({{InsertTest.testEmptyTTL}}). But {{Attributes.getTimestamp()}} has no 
> such check. It validates the empty buffer, and 
> {{LongType.instance.compose()}} returns null for it, which is then unboxed 
> into a long.
> Expected: an InvalidRequestException, like the one for a null value ("Invalid 
> null value of timestamp"), instead of a server error.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to