db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5274) getColumns() doesn't work with auto generated identity columns that start with large numbers
Date Wed, 15 Jun 2011 10:04:47 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13049699#comment-13049699
] 

Knut Anders Hatlen commented on DERBY-5274:
-------------------------------------------

The upgrade tests didn't pass with the proposed fix. The problem seems to be DERBY-1745 (System
catalog columns of type BIGINT and INT created with incorrect precision of zero). Since the
CHAR function uses the column meta-data to determine the length of the return value, it gets
confused by the reported zero precision of the BIGINT columns in system tables created in
old versions of Derby (10.3.1.4 and earlier).

In the upgrade tests, getColumns() would fail with errors like "A truncation error was encountered
trying to shrink CHAR '648518346341351400' to length 1." when run in a database soft or hard
upgraded from 10.3.1.4 or earlier.

I think we can work around DERBY-1745 by going back to the old approach of using a CAST operator
and just change the target type from CHAR(12) to CHAR(20). Even if DERBY-1745 is fixed, we
probably still need the workaround for soft upgraded databases, since fixing the meta-data
for system tables would most likely require a full upgrade. 

> getColumns() doesn't work 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
>            Assignee: Knut Anders Hatlen
>            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

        

Mime
View raw message