You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Konstantin (Jira)" <ji...@apache.org> on 2019/10/07 12:12:00 UTC

[jira] [Created] (CASSANDRA-15345) Incorrect result on conditional UPDATE with static and regular conditions

Konstantin created CASSANDRA-15345:
--------------------------------------

             Summary: Incorrect result on conditional UPDATE with static and regular conditions
                 Key: CASSANDRA-15345
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15345
             Project: Cassandra
          Issue Type: Bug
          Components: CQL/Semantics
            Reporter: Konstantin


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;

```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org