cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shuler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-10277) Empty BATCH throws exception in Cassandra
Date Thu, 10 Sep 2015 21:59:47 GMT

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

Michael Shuler commented on CASSANDRA-10277:
--------------------------------------------

This has some batch validation tests and it looks like it might be a good place to add one
for an empty statement:  {{test/unit/org/apache/cassandra/cql3/validation/operations/BatchTest.java}}

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

Mime
View raw message