cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arvind Nithrakashyap (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-7441) Deleting an element from a list in UPDATE does not work with IF condition
Date Tue, 24 Jun 2014 17:54:25 GMT
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)

Mime
View raw message