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 A677210E5B for ; Wed, 2 Apr 2014 16:53:38 +0000 (UTC) Received: (qmail 58964 invoked by uid 500); 2 Apr 2014 16:53:32 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 58712 invoked by uid 500); 2 Apr 2014 16:53:27 -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 57580 invoked by uid 99); 2 Apr 2014 16:53:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2014 16:53:21 +0000 Date: Wed, 2 Apr 2014 16:53:21 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6914) Map element is not allowed in CAS condition with DELETE/UPDATE query 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-6914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13957880#comment-13957880 ] Tyler Hobbs commented on CASSANDRA-6914: ---------------------------------------- Overall it looks good. In ColumnCondition.equalsTo(), this check is wrong: {code} else if (other.collectionElement == null || !other.collectionElement.bindAndGet(variables).equals(other.collectionElement.bindAndGet(variables))) {code} it should be: {code} else if (other.collectionElement == null || !collectionElement.bindAndGet(variables).equals(other.collectionElement.bindAndGet(other.variables))) {code} I'd like to see the error cases tested as well: * Negative list index * List index out of range * Element access on sets * Element access on non-collection types * Null element access for maps and sets * Two non-equal conditions > Map element is not allowed in CAS condition with DELETE/UPDATE query > -------------------------------------------------------------------- > > Key: CASSANDRA-6914 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6914 > Project: Cassandra > Issue Type: Bug > Reporter: Dmitriy Ukhlov > Assignee: Sylvain Lebresne > Fix For: 2.0.7 > > Attachments: 6914.txt > > > {code} > CREATE TABLE test (id int, data map, PRIMARY KEY(id)); > INSERT INTO test (id, data) VALUES (1,{'a':'1'}); > DELETE FROM test WHERE id=1 IF data['a']=null; > Bad Request: line 1:40 missing EOF at '=' > UPDATE test SET data['b']='2' WHERE id=1 IF data['a']='1'; > Bad Request: line 1:53 missing EOF at '=' > {code} > These queries was successfuly executed with cassandra 2.0.5, but don't work in 2.0.6 release -- This message was sent by Atlassian JIRA (v6.2#6252)