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

Jonathan Ellis updated CASSANDRA-7441:
--------------------------------------

         Priority: Minor  (was: Critical)
    Fix Version/s:     (was: 2.0.7)

> 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
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>
> 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)

Reply via email to