Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Invalid
-
None
-
None
-
All
-
None
Description
The below example conditional update is wrongly evaluated to True and applied even though clustering key 'k1' is not present in the table:
CREATE KEYSPACE test_keyspace WITH replication = \{'class': 'SimpleStrategy', 'replication_factor': 1}; CREATE TABLE test_table (id int, k text, version int static, v text, PRIMARY KEY (id, k)); INSERT INTO test_table(id, version) VALUES (0, 0); SELECT * FROM test_table; id | k | version | v ----+------+---------+------ 0 | null | 0 | null (1 rows) SELECT * FROM test_table WHERE id=0 AND k='k1'; id | k | version | v ----+---+---------+--- (0 rows) UPDATE test_table SET v='foo', version=1 WHERE id=0 AND k='k1' IF version = 0; [applied] ----------- True SELECT * FROM test_table; id | k | version | v ----+----+---------+----- 0 | k1 | 1 | foo (1 rows) DROP TABLE test_table; DROP KEYSPACE test_keyspace;