[ https://issues.apache.org/jira/browse/CASSANDRA-6430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14173991#comment-14173991 ]
Tyler Hobbs commented on CASSANDRA-6430: ---------------------------------------- It sounds like the best option for now is to require that the full primary key be specified when IF conditions are used in DELETEs. If we want to reconsider allowing the statement in the description, we can always do that later. > 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 > > > 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)