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

Vovodroid updated CASSANDRA-10277:
----------------------------------
    Flags:   (was: Patch)

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

Reply via email to