cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sungkyu Kang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6430) DELETE with IF <field>=<value> clause doesn't work properly if more then one row are going to be deleted
Date Thu, 29 May 2014 18:37:01 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-6430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14012675#comment-14012675
] 

Sungkyu Kang commented on CASSANDRA-6430:
-----------------------------------------

Looks like IF keyword is for lightweight transaction, and it's assumed that both keys are
specified. Maybe it should support the primary key only case, or report proper error message.

> 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
>
> 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.2#6252)

Mime
View raw message