You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Stefania (JIRA)" <ji...@apache.org> on 2015/03/11 07:25:38 UTC

[jira] [Commented] (CASSANDRA-8900) AssertionError when binding nested collection in a DELETE

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

Stefania commented on CASSANDRA-8900:
-------------------------------------

Reproduced with python driver as well, here is the dtest:

{code}
    def delete_frozen_map_test(self):
        """
        This test used to give an AssertionError, see CASSANDRA-8900
        """

        self.cluster.populate(1).start()
        node = self.cluster.nodes.values()[0]

        session = self.patient_cql_connection(node)
        session.execute("""
            CREATE KEYSPACE IF NOT EXISTS %s
            WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': '1' }
            """ % KEYSPACE)

        session.set_keyspace(KEYSPACE)
        session.execute("create table if not exists foo2(k int primary key, m map<frozen<list<int>>, int>)")

        statement = session.prepare("delete m[?] from foo2 where k = 1")

        session.execute(statement, ([1],))
{code}

> AssertionError when binding nested collection in a DELETE
> ---------------------------------------------------------
>
>                 Key: CASSANDRA-8900
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8900
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Olivier Michallat
>            Assignee: Stefania
>            Priority: Minor
>             Fix For: 2.1.4
>
>
> Running this with the Java driver:
> {code}
> session.execute("create table if not exists foo2(k int primary key, m map<frozen<list<int>>, int>);");
> PreparedStatement pst = session.prepare("delete m[?] from foo2 where k = 1");
> session.execute(pst.bind(ImmutableList.of(1)));
> {code}
> Produces a server error. Server-side stack trace:
> {code}
> ERROR [SharedPool-Worker-4] 2015-03-03 13:33:24,740 Message.java:538 - Unexpected exception during request; channel = [id: 0xf9e92e61, /127.0.0.1:58163 => /127.0.0.1:9042]
> java.lang.AssertionError: null
>         at org.apache.cassandra.cql3.Maps$DiscarderByKey.execute(Maps.java:381) ~[main/:na]
>         at org.apache.cassandra.cql3.statements.DeleteStatement.addUpdateForKey(DeleteStatement.java:85) ~[main/:na]
>         at org.apache.cassandra.cql3.statements.ModificationStatement.getMutations(ModificationStatement.java:654) ~[main/:na]
>         at org.apache.cassandra.cql3.statements.ModificationStatement.executeWithoutCondition(ModificationStatement.java:487) ~[main/:na]
>         at org.apache.cassandra.cql3.statements.ModificationStatement.execute(ModificationStatement.java:473) ~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:238) ~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.processPrepared(QueryProcessor.java:493) ~[main/:na]
>         at org.apache.cassandra.transport.messages.ExecuteMessage.execute(ExecuteMessage.java:134) ~[main/:na]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:439) [main/:na]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:335) [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_60]
>         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:745) [na:1.7.0_60]
> {code}
> A simple statement (i.e. QUERY message with values) produces the same result:
> {code}
> session.execute("delete m[?] from foo2 where k = 1", ImmutableList.of(1));
> {code}



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