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 F15F517B02 for ; Wed, 11 Feb 2015 17:51:12 +0000 (UTC) Received: (qmail 10107 invoked by uid 500); 11 Feb 2015 17:51:12 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 10070 invoked by uid 500); 11 Feb 2015 17:51:12 -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 10058 invoked by uid 99); 11 Feb 2015 17:51:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2015 17:51:12 +0000 Date: Wed, 11 Feb 2015 17:51:12 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8779) Able to unintentionally nest tuples during insert MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8779?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 14316625#comment-14316625 ]=20 Tyler Hobbs commented on CASSANDRA-8779: ---------------------------------------- I'm not having any luck reproducing (with the python driver) against 2.1.2 = or cassandra-2.1 head. This should be equivalent to what the Ruby/Java dri= vers are producing, correct? {noformat} session.execute("INSERT INTO ks1.test (a, b) VALUES (0, (('foo', 123, true)= ))") {noformat} I get the correct error when executing that: {noformat} cassandra.InvalidRequest: code=3D2200 [Invalid query] message=3D"Invalid tu= ple literal for b: component 0 is not of type ascii" {noformat} > Able to unintentionally nest tuples during insert > ------------------------------------------------- > > Key: CASSANDRA-8779 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8779 > Project: Cassandra > Issue Type: Bug > Environment: Linux Mint 64-bit | ruby-driver 2.1 | java-driver 2.= 1 | C* 2.1.2 > Reporter: Kishan Karunaratne > Assignee: Tyler Hobbs > > If I insert a tuple using an extra pair of ()'s, C* will let me do the in= sert, but (incorrectly) creates a nested tuple as the first tuple value. Up= on doing a select statement, the result is jumbled and has weird binary in = it (which I wasn't able to copy into here). > Example using ruby-driver: > {noformat} > session.execute("CREATE TABLE mytable (a int PRIMARY KEY, b frozen>)") > complete =3D Cassandra::Tuple.new('foo', 123, true) > session.execute("INSERT INTO mytable (a, b) VALUES (0, (?))", arguments: = [complete]) # extra ()'s here > result =3D session.execute("SELECT b FROM mytable WHERE a=3D0").first > p result['b'] > {noformat} > Output: > {noformat} > # > {noformat} > Bug also confirmed using java-driver.=20 > Example using java-driver: > {noformat} > session.execute("CREATE TABLE mytable (a int PRIMARY KEY, b frozen>)"); > TupleType t =3D TupleType.of(DataType.ascii(), DataType.cint(), DataType.= cboolean()); > TupleValue complete =3D t.newValue("foo", 123, true); > session.execute("INSERT INTO mytable (a, b) VALUES (0, (?))", complete); = // extra ()'s here > TupleValue r =3D session.execute("SELECT b FROM mytable WHERE a=3D0").one= ().getTupleValue("b"); > System.out.println(r); > {noformat} > Output: > {noformat} > ('=03foo=04{=01=01', null, null) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)