Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Duplicate
-
None
-
None
-
None
-
Low
Description
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:
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)
Addition seems to work though
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)
Attachments
Issue Links
- duplicates
-
CASSANDRA-7499 Unable to update list element by index using CAS condition
- Resolved