cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-6430) DELETE with IF <field>=<value> clause doesn't work properly if more then one row are going to be deleted
Date Thu, 16 Oct 2014 20:51:34 GMT

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

Tyler Hobbs updated CASSANDRA-6430:
-----------------------------------
    Attachment: 6430-2.0.txt

6430-2.0.txt validates that all PK columns are restricted when performing conditional deletes.
 I've also pushed a [dtest|https://github.com/thobbs/cassandra-dtest/tree/CASSANDRA-6430]
that covers this.

> DELETE with IF <field>=<value> clause doesn't work properly if more then
one row are going to be deleted
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6430
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6430
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Dmitriy Ukhlov
>            Assignee: Tyler Hobbs
>             Fix For: 2.0.11
>
>         Attachments: 6430-2.0.txt
>
>
> CREATE TABLE test(key int, sub_key int, value text, PRIMARY KEY(key, sub_key) );
> INSERT INTO test(key, sub_key, value) VALUES(1,1, '1.1');
> INSERT INTO test(key, sub_key, value) VALUES(1,2, '1.2');
> INSERT INTO test(key, sub_key, value) VALUES(1,3, '1.3');
> SELECT * from test;
>  key | sub_key | value
> -----+---------+-------
>    1 |       1 |   1.1
>    1 |       2 |   1.2
>    1 |       3 |   1.3
> DELETE FROM test WHERE key=1 IF value='1.2';
>  [applied]
> -----------
>      False     <=============== I guess second row should be removed
> SELECT * from test;
>  key | sub_key | value
> -----+---------+-------
>    1 |       1 |   1.1
>    1 |       2 |   1.2
>    1 |       3 |   1.3
> (3 rows) 
> DELETE FROM test WHERE key=1;
> SELECT * from test;
> (0 rows)          <=========== all rows were removed: OK



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message