[ 
https://issues.apache.org/jira/browse/CASSANDRA-18113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17681947#comment-17681947
 ] 

Stefan Miklosovic commented on CASSANDRA-18113:
-----------------------------------------------

Hi [~n.v.harikrishna], thanks for this patch. I am +1 here, I just need to run 
the builds and get a review for some other committer.

I am not sure what to do with the issue you found with the output as described 
in the PR. This seems like a legit bug but it is out of scope of this PR. I 
suggest to merge this one which solves NPE and then we might create another one 
which fixes the output. That seems to be the most ideal solution here.

[~brandon.williams] would you go through this, please, once you have 5 minutes 
(1) ? Very easy patch, easy to understand. Do you agree with fixing just NPE 
here and then fixing the output in the other ticket?

(1) https://github.com/apache/cassandra/pull/2050

> fqltool dump results NPE when null value inserted using prepared query
> ----------------------------------------------------------------------
>
>                 Key: CASSANDRA-18113
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18113
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tool/fql
>            Reporter: n.v.harikrishna
>            Assignee: n.v.harikrishna
>            Priority: Normal
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Enable fullquerylog, prepare insert statement and bind it with a null value 
> and execute it. Executing fqltool dump after insert will result into 
> NullPointerException.
>  
> Stept to reproduce:
>     * Create cluster using ccm
>     * Create  a table something like:
> {code:java}
>     CREATE TABLE ks1.t2 (
>         id int PRIMARY KEY,
>         value text
>     ) ;
>  {code}
>     * Execute below code
> {code:java}
>     try (CqlSession cqlSession = CqlSession.builder().build()) {
>         PreparedStatement preparedStatement = cqlSession.prepare("INSERT INTO 
> ks1.t2 (id, value) VALUES (?, ?)");
>         cqlSession.execute(preparedStatement.bind(6, null));
>     }
> {code}
>     * Now running fqltool dump. It will run into NPE
>  
>  
> Stack trace:
> {code:java}
> error: null
> -- StackTrace --
> java.lang.NullPointerException
>     at net.openhft.chronicle.bytes.BytesStore.wrap(BytesStore.java:76)
>     at net.openhft.chronicle.bytes.Bytes.wrapForRead(Bytes.java:179)
>     at 
> org.apache.cassandra.fqltool.commands.Dump.appendValuesToStringBuilder(Dump.java:222)
>     at org.apache.cassandra.fqltool.commands.Dump.dumpQuery(Dump.java:179)
>     at org.apache.cassandra.fqltool.commands.Dump.lambda$dump$0(Dump.java:123)
>     at 
> net.openhft.chronicle.queue.impl.single.StoreTailer.readDocument(StoreTailer.java:111)
>     at org.apache.cassandra.fqltool.commands.Dump.dump(Dump.java:148)
>     at org.apache.cassandra.fqltool.commands.Dump.run(Dump.java:68)
>     at 
> org.apache.cassandra.fqltool.FullQueryLogTool.main(FullQueryLogTool.java:65)
> {code}



--
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