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 88AEF1076B for ; Thu, 13 Mar 2014 21:29:49 +0000 (UTC) Received: (qmail 87314 invoked by uid 500); 13 Mar 2014 21:29:46 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 87282 invoked by uid 500); 13 Mar 2014 21:29: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 87272 invoked by uid 99); 13 Mar 2014 21:29:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2014 21:29:46 +0000 Date: Thu, 13 Mar 2014 21:29:46 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-6643) Limit user types to the keyspace they are defined in 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-6643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-6643: -------------------------------------- Assignee: Sylvain Lebresne > Limit user types to the keyspace they are defined in > ---------------------------------------------------- > > Key: CASSANDRA-6643 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6643 > Project: Cassandra > Issue Type: Bug > Environment: java version "1.7.0_51" > cassandra from trunk, 4b54b8... > Reporter: Russ Hatch > Assignee: Sylvain Lebresne > Priority: Minor > Fix For: 2.1 beta2 > > > I'm not 100% certain this is a bug. > The current syntax for "alter type rename" requires the keyspace on the old and new table name (if a keyspace is not active). So, to rename the type 'foo' to 'bar', you have to issue this statement: > ALTER TYPE ks.foo rename to ks.bar . > As a result, this syntax will also allow renaming the type into another existing keyspace, which updates the metadata in system.schema_usertypes. > I'm wondering if perhaps we can omit the second keyspace prefix and implicitly rename into the same keyspace. > To reproduce: > {noformat} > cqlsh> create keyspace user_types with replication = {'class':'SimpleStrategy', 'replication_factor':3} ; > cqlsh> create keyspace user_types2 with replication = {'class':'SimpleStrategy', 'replication_factor':3} ; > cqlsh> CREATE TYPE user_types.simple_type (user_number int); > cqlsh> alter type user_types.simple_type rename to user_types2.simple_type; > {noformat} > Renaming to another keyspace is also possible when a keyspace is active, like so: > {noformat} > cqlsh:user_types> alter type simple_type rename to user_types2.simple_type; > {noformat} -- This message was sent by Atlassian JIRA (v6.2#6252)