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 9638B1052B for ; Mon, 14 Oct 2013 09:19:55 +0000 (UTC) Received: (qmail 31287 invoked by uid 500); 14 Oct 2013 09:19:50 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 31063 invoked by uid 500); 14 Oct 2013 09:19: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 30963 invoked by uid 99); 14 Oct 2013 09:19:44 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 09:19:44 +0000 Date: Mon, 14 Oct 2013 09:19:44 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6185) Can't update int column to blob type. 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-6185?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 13794007#comment-13794007 ]=20 Sylvain Lebresne commented on CASSANDRA-6185: --------------------------------------------- bq. or is this actually a regression? Kind of. In CASSANDRA-5882, we decided on purpose to stop allowing type cha= nges that were not making sense. In doing so, we've been too restrictive, d= isallowing some type changes that stricly speaking make sense, which you co= uld say is a restriction (of CASSANDRA-5882). I'll note that the patch really only change code related to altering type, = which is hardly mission critical, so I don't think there is too much risk i= n pushing it in 1.2. But personally I don't really care either way. > Can't update int column to blob type. > ------------------------------------- > > Key: CASSANDRA-6185 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6185 > Project: Cassandra > Issue Type: Bug > Reporter: Nick Bailey > Assignee: Sylvain Lebresne > Priority: Minor > Fix For: 2.0.2 > > Attachments: 6185.txt > > > Patch for dtests: > {noformat} > diff --git a/cql_tests.py b/cql_tests.py > index 11461e4..405c998 100644 > --- a/cql_tests.py > +++ b/cql_tests.py > @@ -1547,35 +1547,35 @@ class TestCQL(Tester): > CREATE TABLE test ( > k text, > c text, > - v text, > + v int, > PRIMARY KEY (k, c) > ) > """) > - req =3D "INSERT INTO test (k, c, v) VALUES ('%s', '%s', '%s')" > + req =3D "INSERT INTO test (k, c, v) VALUES ('%s', '%s', %d)" > # using utf8 character so that we can see the transition to Byte= sType > - cursor.execute(req % ('=C9=B8', '=C9=B8', '=C9=B8')) > + cursor.execute(req % ('=C9=B8', '=C9=B8', 1)) > cursor.execute("SELECT * FROM test") > cursor.execute("SELECT * FROM test") > res =3D cursor.fetchall() > - assert res =3D=3D [[u'=C9=B8', u'=C9=B8', u'=C9=B8']], res > + assert res =3D=3D [[u'=C9=B8', u'=C9=B8', 1]], res > cursor.execute("ALTER TABLE test ALTER v TYPE blob") > cursor.execute("SELECT * FROM test") > res =3D cursor.fetchall() > # the last should not be utf8 but a raw string > - assert res =3D=3D [[u'=C9=B8', u'=C9=B8', '=C9=B8']], res > + assert res =3D=3D [[u'=C9=B8', u'=C9=B8', '\x00\x00\x00\x01']], = res > cursor.execute("ALTER TABLE test ALTER k TYPE blob") > cursor.execute("SELECT * FROM test") > res =3D cursor.fetchall() > - assert res =3D=3D [['=C9=B8', u'=C9=B8', '=C9=B8']], res > + assert res =3D=3D [['=C9=B8', u'=C9=B8', '\x00\x00\x00\x01']], r= es > cursor.execute("ALTER TABLE test ALTER c TYPE blob") > cursor.execute("SELECT * FROM test") > res =3D cursor.fetchall() > - assert res =3D=3D [['=C9=B8', '=C9=B8', '=C9=B8']], res > + assert res =3D=3D [['=C9=B8', '=C9=B8', '\x00\x00\x00\x01']], re= s > @since('1.2') > def composite_row_key_test(self): > {noformat} -- This message was sent by Atlassian JIRA (v6.1#6144)