Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Not A Problem
-
None
-
Low
Description
First, create keyspace and a table using the following
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'};
then, execute the following cql:
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;
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.