You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jorge Bay (JIRA)" <ji...@apache.org> on 2015/05/18 11:37:01 UTC

[jira] [Created] (CASSANDRA-9411) Bound statement executions fail after adding a collection-type column

Jorge Bay created CASSANDRA-9411:
------------------------------------

             Summary: Bound statement executions fail after adding a collection-type column
                 Key: CASSANDRA-9411
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9411
             Project: Cassandra
          Issue Type: Bug
         Environment: Cassandra 2.0.13.
OS X 10.9
            Reporter: Jorge Bay


After adding a collection-type column to an existing table, executions of statements that are already prepared result in server error (error code 0), with the error message {{java.lang.ArrayIndexOutOfBoundsException}}.

To reproduce it.
{code:java}
session.execute("CREATE TABLE tbl1 (a text, b text, c text, PRIMARY KEY (a, b))");
//prepare initially
PreparedStatement ps = session.prepare("SELECT a, b, c FROM tbl1");
//insert some data
session.execute("INSERT INTO tbl1 (a, b, c) VALUES ('a1', 'b1', 'c1')");
//Executes successfully as expected
session.execute(ps.bind());
//Add a column of a collection type
session.execute("ALTER TABLE tbl1 ADD d set<text>");
//All following executions fail
session.execute(ps.bind());
{code}

Some notes:
- This only occurs for SELECT with fields (not with SELECT *)
- This only occurs with C* 2.0. Probably because CASSANDRA-7910 was applied for 2.1+
- This only occurs if the column added is a collection type (list / set / map)
- This occurs with all SELECT statements using that column family, that were already prepared.

Repreparing it on all hosts fixes the issue, but for that, the user should normally restart existing application (even if the existing apps/apps versions don't handle this new field).



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