From derby-dev-return-45859-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Mon Jul 02 16:39:27 2007 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 69540 invoked from network); 2 Jul 2007 16:39:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 16:39:26 -0000 Received: (qmail 27411 invoked by uid 500); 2 Jul 2007 16:39:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 27383 invoked by uid 500); 2 Jul 2007 16:39:28 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 27374 invoked by uid 99); 2 Jul 2007 16:39:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 09:39:28 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 09:39:24 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A4D447141EA for ; Mon, 2 Jul 2007 09:39:04 -0700 (PDT) Message-ID: <10729885.1183394344671.JavaMail.jira@brutus> Date: Mon, 2 Jul 2007 09:39:04 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-2879) CREATE TABLE AS does not maintain the collation for character types. In-Reply-To: <7507676.1182953905874.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-2879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509612 ] Mamta A. Satoor commented on DERBY-2879: ---------------------------------------- I have checked in following code in CreateTableNode + (schemaCollationType == + StringDataValue.COLLATION_TYPE_UCS_BASIC ? + Property.UCS_BASIC_COLLATION : + Property.TERRITORY_BASED_COLLATION); Basically, the code above is trying to find the string representation for the int collation type so that string can be used in the exception that will be thrown. There is similar code to get string representation from the TypeDescriptor's collaiton type in TypeDescriptorImpl.java which is as follows public String getCollationName() { return( collationType == StringDataValue.COLLATION_TYPE_UCS_BASIC ? Property.UCS_BASIC_COLLATION : Property.TERRITORY_BASED_COLLATION); } I wonder if there is any common utility class where I can move this logic from TypeDescriptorImpl and CreateTableNode so the code is not duplicated. Please let me know if there is any recommendation for where I can move this code. > CREATE TABLE AS does not maintain the collation for character types. > ------------------------------------------------------------------------------- > > Key: DERBY-2879 > URL: https://issues.apache.org/jira/browse/DERBY-2879 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.3.1.0, 10.3.1.1, 10.4.0.0 > Reporter: Daniel John Debrunner > Assignee: Mamta A. Satoor > Priority: Critical > > create table t as select tablename from sys.systables with no data; > This creates a column TABLENAME with collation based upon the user schema, but the type of sys.systables.tablename has collation UCS_BASIC. > The required behaviour should be verified with the SQL standard (11.3 SR6), but since collation is an attribute of a type it seems logical that the collation is maintained by the create. > Fixing this to keep the collation of the system column will cause problems though as there would be no way to recreate this table through a regular create table, say if the schema is dumped and recreated using ddlutils. > I think this is critical as fixing it after a release would lead to a change in behaviour for applications. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.