You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Arvind Nithrakashyap (JIRA)" <ji...@apache.org> on 2014/06/24 19:54:25 UTC

[jira] [Created] (CASSANDRA-7441) Deleting an element from a list in UPDATE does not work with IF condition

Arvind Nithrakashyap created CASSANDRA-7441:
-----------------------------------------------

             Summary: Deleting an element from a list in UPDATE does not work with IF condition
                 Key: CASSANDRA-7441
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7441
             Project: Cassandra
          Issue Type: Bug
          Components: Core
            Reporter: Arvind Nithrakashyap
            Priority: Critical
             Fix For: 2.0.7


When issuing a list deletion with an IF condition, that does not seem to work even when it says that the change was applied correctly. 

Here's a reproducible test case:

{code}
cqlsh:casstest> create table foo(id text, values list<int>, condition int, primary key(id));
cqlsh:casstest> insert into foo(id, values, condition)  values ('a', [1,2,3], 0);
cqlsh:casstest> select * from foo;

 id | condition | values
----+-----------+-----------
  a |         0 | [1, 2, 3]

(1 rows)

cqlsh:casstest> update foo set values = values - [3] where id = 'a' IF condition = 0;

 [applied]
-----------
      True

cqlsh:casstest> select * from foo;

 id | condition | values
----+-----------+-----------
  a |         0 | [1, 2, 3]

(1 rows)

cqlsh:casstest> update foo set values = values - [3] where id = 'a';
cqlsh:casstest> select * from foo;

 id | condition | values
----+-----------+--------
  a |         0 | [1, 2]

(1 rows)

{code}

Addition seems to work though

{code}

cqlsh:casstest> update foo set values = values + [3] where id = 'a' IF condition = 0;

 [applied]
-----------
      True

cqlsh:casstest> select * from foo;

 id | condition | values
----+-----------+-----------
  a |         0 | [1, 2, 3]

(1 rows)

{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)