You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "mmh (JIRA)" <ji...@apache.org> on 2017/08/21 05:19:01 UTC
[jira] [Updated] (CASSANDRA-13767) update a row which was inserted
with 'IF NOT EXISTS' key word will fail siently
[ https://issues.apache.org/jira/browse/CASSANDRA-13767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
mmh updated CASSANDRA-13767:
----------------------------
Description:
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.
was:
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-9801a7a97471, 0) IF NOT EXISTS;
insert into job_info (id, create_time) values (5be224c6-8231-11e7-9619-9801a7a97471, 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.
> 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.0
>
>
> 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
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org