Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78450100D5 for ; Mon, 21 Oct 2013 03:41:59 +0000 (UTC) Received: (qmail 6138 invoked by uid 500); 21 Oct 2013 03:41:58 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 5189 invoked by uid 500); 21 Oct 2013 03:41:46 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 5180 invoked by uid 99); 21 Oct 2013 03:41:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 03:41:42 +0000 Date: Mon, 21 Oct 2013 03:41:42 +0000 (UTC) From: "Mikhail Stepura (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6221) CQL3 statements not executed properly inside BATCH operation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13800331#comment-13800331 ] Mikhail Stepura commented on CASSANDRA-6221: -------------------------------------------- I'm able to reproduce this in both {{cassandra-2.0.0}} and {{cassandra-2.0.1}} tags, however with latest branch {{cassandra-2.0}} all works fine > CQL3 statements not executed properly inside BATCH operation. > ------------------------------------------------------------- > > Key: CASSANDRA-6221 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6221 > Project: Cassandra > Issue Type: Bug > Environment: Running on Linux RHEL 6.2 with just a single node cluster. A very basic configuration. You need a CQL3 table with a composite key. Bug occurs while attempting to do both a DELETE and INSERT INTO operation inside a BATCH block. > Reporter: Andy Klages > Fix For: 2.0.0 > > > I'm encountering a problem introduced in 2.0.0 where I have 2 CQL3 statements within a BEGIN BATCH - APPLY BATCH operator and the first one seems to be ignored. Both statements operate on the same table and the first one does a DELETE of an existing record, followed by an INSERT of a new record. The table must have a composite key. NOTE that this worked fine in 1.2.10. > Here is a simple example of CQL3 statements to reproduce this: > -- Following table has a composite key. > CREATE TABLE users ( > user_id bigint, > id bigint, > name varchar, > PRIMARY KEY(user_id, id) > ); > -- Insert record with key <100,1> > INSERT INTO users (user_id,id,name) VALUES (100,1,'jdoe'); > -- Following returns 1 row as expected. > SELECT * FROM users; > -- Attempt to delete <100,1> while inserting <100,2> as BATCH > BEGIN BATCH > DELETE FROM users WHERE user_id=100 AND id=1; > INSERT INTO users (user_id,id,name) VALUES (100,2,'jdoe'); > APPLY BATCH; > -- Following but should return only <100,2> but <100,1> is also returned > SELECT * FROM users; > The output from the first select which is correct: > user_id | id | name > ---------+----+------ > 100 | 1 | jdoe > The output from the second select which is incorrect is: > user_id | id | name > ---------+----+------ > 100 | 1 | jdoe > 100 | 2 | jdoe > Only the second row (<100,2>) should've been returned. This was the behavior in 1.2.10. -- This message was sent by Atlassian JIRA (v6.1#6144)