cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-9559) IndexOutOfBoundsException inserting into TupleType
Date Thu, 25 Jun 2015 19:03:04 GMT

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

Benjamin Lerer updated CASSANDRA-9559:
--------------------------------------
    Attachment: 9559-2.txt

The patch fixes the issues found.

The unit tests results are [here|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-9559-testall/lastCompletedBuild/testReport/]
and the DTests results are [here|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-9559-dtest/lastCompletedBuild/testReport/]

> IndexOutOfBoundsException inserting into TupleType
> --------------------------------------------------
>
>                 Key: CASSANDRA-9559
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9559
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: dan jatnieks
>            Assignee: Benjamin Lerer
>             Fix For: 2.1.x, 2.2.x
>
>         Attachments: 9559-2.txt, 9559.txt
>
>
> Trying to run this query on the 2.2 branch resulted in IndexOutOfBoundsException:
> {noformat}
> INSERT INTO datatypes.alltypes (pk,c_tuple) VALUES (1,'01:02:03.456789012')
> {noformat}
> The column {{c_tuple}} is of type {{tuple<int>}}.
> The cause seems to be that {{TupleType.fromString}} is splitting the source string on
{{:}} (meant for UDT only?) but does not consider that the number of those fields may exceed
the number of types defined in the Tuple. 
> A simple fix would be to bound the for loop with {{types.size()}} instead of {{fieldStrings.size()}}
but still some error should be raised if {{fieldStrings.size() > types.size()}}.
> {noformat}
> java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
>         at java.util.ArrayList.rangeCheck(ArrayList.java:635) ~[na:1.7.0_51]
>         at java.util.ArrayList.get(ArrayList.java:411) ~[na:1.7.0_51]
>         at org.apache.cassandra.db.marshal.TupleType.type(TupleType.java:60) ~[main/:na]
>         at org.apache.cassandra.db.marshal.TupleType.fromString(TupleType.java:224) ~[main/:na]
>         at org.apache.cassandra.cql3.Constants$Literal.parsedValue(Constants.java:152)
~[main/:na]
>         at org.apache.cassandra.cql3.Constants$Literal.prepare(Constants.java:138) ~[main/:na]
>         at org.apache.cassandra.cql3.Constants$Literal.prepare(Constants.java:91) ~[main/:na]
>         at org.apache.cassandra.cql3.Operation$SetValue.prepare(Operation.java:167) ~[main/:na]
>         at org.apache.cassandra.cql3.statements.UpdateStatement$ParsedInsert.prepareInternal(UpdateStatement.java:213)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:710)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.ModificationStatement$Parsed.prepare(ModificationStatement.java:698)
~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:493)
~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:247)
~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:241)
~[main/:na]
>         at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:119)
~[main/:na]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:507)
[main/:na]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:401)
[main/:na]
>         at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
>         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
>         at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
>         at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324)
[netty-all-4.0.23.Final.jar:4.0.23.Final]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_51]
>         at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164)
[main/:na]
>         at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [main/:na]
>         at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
> {noformat}



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

Mime
View raw message