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

Michael Shuler updated CASSANDRA-13767:
---------------------------------------
    Fix Version/s:     (was: 3.11.0)
                   3.11.x

> update a row which was inserted with 'IF NOT EXISTS' key word will fail 
> siently
> -------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-13767
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13767
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>         Environment: [cqlsh 5.0.1 | Cassandra 3.11.0 | CQL spec 3.4.4 | 
> Native protocol v4]
> cassandra python driver = 3.5.0
> Run in dcoker with the following:
> docker run --name cassandra -v /data/cassandra:/var/lib/cassandra    
> -p9042:9042 -p9160:9160 -p7000:7000 -p7001:7001  cassandra
>            Reporter: mmh
>            Priority: Minor
>             Fix For: 3.11.x
>
>
> First, create keyspace and a table using the following
> {code:java}
> CREATE KEYSPACE scheduler WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': '1'}  AND durable_writes = true;
> CREATE TABLE scheduler.job_info (
>     id timeuuid PRIMARY KEY,
>     create_time int,
>     cur_retry int,
>     cur_run_times int,
>     expire_time int,
>     max_retry int,
>     max_run_times int,
>     payload text,
>     period int,
>     retry_interval int,
>     status tinyint,
>     topic text,
>     type text,
>     update_time int
> ) with caching = {'keys':'ALL', 'rows_per_partition':'NONE'};
> {code}
> then, execute the following cql:
> {code:java}
> insert into job_info (id, create_time) values 
> (5be224c6-8231-11e7-9619-9801b2a97471, 0) IF NOT EXISTS;
> insert into job_info (id, create_time) values 
> (5be224c6-8231-11e7-9619-9801b2a97471, 1);
> select * from job_info;
> {code}
> You will find that create_time is still 0, it is not updated.
> but, if you remove the IF NOT EXISTS keyword in the first cql, the update 
> will success.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to