Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 72ABC63FD for ; Tue, 14 Jun 2011 16:48:09 +0000 (UTC) Received: (qmail 91569 invoked by uid 500); 14 Jun 2011 16:48:09 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 91542 invoked by uid 500); 14 Jun 2011 16:48:09 -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 91535 invoked by uid 99); 14 Jun 2011 16:48:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2011 16:48:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2011 16:48:07 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id AAC8741687D for ; Tue, 14 Jun 2011 16:47:47 +0000 (UTC) Date: Tue, 14 Jun 2011 16:47:47 +0000 (UTC) From: "Tony Brusseau (JIRA)" To: derby-dev@db.apache.org Message-ID: <1996825910.3226.1308070067696.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1895340828.3758.1307997591551.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Issue Comment Edited] (DERBY-5274) Cannot create tables correctly with auto generated identity columns that start with large numbers 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/DERBY-5274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048790#comment-13048790 ] Tony Brusseau edited comment on DERBY-5274 at 6/14/11 4:47 PM: --------------------------------------------------------------- This works: CREATE TABLE kb.term ( term_id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 999999999999) ); This fails (silently): CREATE TABLE kb.term ( term_id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1000000000000) ); Looks like 1 trillion is the magic cutoff where it stops working. ********************************************************************** In the Squirrel SQL Client I get the following error message when trying to browse the columns for the table: Unable to get list of columns java.sql.SQLException: The exception 'java.sql.SQLException: A truncation error was encountered trying to shrink CHAR '648518346341351400' to length 12.' was thrown while evaluating an expression. I'm also unable to see the columns in the Netbeans integration with Derby so I'm guessing this is coming from the Derby side. It's possible that the table is created correctly, but I just can't tell that because of an issue with transferring column meta data to the tools that I'm using to browse the DB schema. ********************************************************************** Here is the message from ij: describe kb.term; ERROR 38000: The exception 'java.sql.SQLException: A truncation error was encountered trying to shrink CHAR '1000000000000' to length 12.' was thrown while evaluating an expression. ERROR 22001: A truncation error was encountered trying to shrink CHAR '1000000000000' to length 12. was (Author: apb): This works: CREATE TABLE kb.term ( term_id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 999999999999) ); This fails (silently): CREATE TABLE kb.term ( term_id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1000000000000) ); Looks like 1 trillion is the magic cutoff where it stops working. ********************************************************************** In the Squirrel SQL Client I get the following error message when trying to browse the columns for the table: Unable to get list of columns java.sql.SQLException: The exception 'java.sql.SQLException: A truncation error was encountered trying to shrink CHAR '648518346341351400' to length 12.' was thrown while evaluating an expression. I'm also unable to see the columns in the Netbeans integration with Derby so I'm guessing this is coming from the Derby side. It's possibly that the table is created correctly, but I just can't tell that because of an issue with transferring column meta data to the tools that I'm using to browse the DB schema. ********************************************************************** Here is the message from ij: describe kb.term; ERROR 38000: The exception 'java.sql.SQLException: A truncation error was encountered trying to shrink CHAR '1000000000000' to length 12.' was thrown while evaluating an expression. ERROR 22001: A truncation error was encountered trying to shrink CHAR '1000000000000' to length 12. > Cannot create tables correctly with auto generated identity columns that start with large numbers > ------------------------------------------------------------------------------------------------- > > Key: DERBY-5274 > URL: https://issues.apache.org/jira/browse/DERBY-5274 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.7.1.1 > Environment: Linux 10.3. > Reporter: Tony Brusseau > Priority: Critical > Attachments: derby-5274-1a-getColumns.diff > > > CREATE TABLE kb.constant_term > ( > term_id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 648518346341351400, INCREMENT BY 1), > constant_name VARCHAR(1024) NOT NULL > ); > The above SQL causes the table to be created but no columns to be defined (no error message is reported). If I change 648518346341351400 to a 0, then the table is created normally with all the columns defined correctly. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira