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] [Updated] (DERBY-5274) getColumns() doesn't work with auto generated identity columns that start with large numbers
Date Thu, 16 Jun 2011 08:53:47 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5274?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-5274:
--------------------------------------

    Attachment: derby-5274-1b-getColumns.diff

Attaching patch 1b that works around DERBY-1745 and makes getColumns() work also in databases
upgraded from old Derby versions.

I used a slightly different workaround than what I suggested above. Instead of converting
the value to a CHAR(20) explicitly, I converted it first to a BIGINT and then using the CHAR
function to a CHAR value with the size derived implicitly. By first converting it to a BIGINT
(which should be unnecessary, since it already is a BIGINT), the meta-data was fixed so that
the CHAR function was able to do the conversion. I preferred this solution since it let us
avoid the magic number 20, and it was another magic number (12) that caused the bug in the
first place.

All regression tests ran cleanly with the patch.

> 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, derby-5274-1b-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