You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Vovodroid (JIRA)" <ji...@apache.org> on 2015/09/11 19:24:46 UTC

[jira] [Comment Edited] (CASSANDRA-10277) Empty BATCH throws exception in Cassandra

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

Vovodroid edited comment on CASSANDRA-10277 at 9/11/15 5:24 PM:
----------------------------------------------------------------

emptytest.patch - test method testBatchEmpty in BatchTest class


was (Author: vovodroid):
Unit test - method testBatchEmpty in BatchTest class

> Empty BATCH throws exception in Cassandra
> -----------------------------------------
>
>                 Key: CASSANDRA-10277
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10277
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Vovodroid
>            Priority: Minor
>         Attachments: emptybatch.patch, emptytest.patch
>
>
> Connect to Cassandra with cqlsh and perform empty BATCH statement:
> {code}BEGIN BATCH  APPLY BATCH;{code}
> Following exception is thrown and logged
> {code}
> ERROR 14:02:07 Unexpected exception during request
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> 	at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[na:1.8.0_45]
> 	at java.util.ArrayList.get(ArrayList.java:429) ~[na:1.8.0_45]
> 	at org.apache.cassandra.cql3.statements.BatchStatement$Parsed.prepare(BatchStatement.java:514) ~[main/:na]
> ...........................
> {code}
> It's caused because of access to batch statement list, even if it's empty.
> Proposed patch (for 2.2.0) is attached.



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