You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2014/05/16 14:36:14 UTC

[jira] [Commented] (DERBY-6578) Assert failure when retrying failed ADD COLUMN statement

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

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

With debug jars:

{noformat}
ij> autocommit off;
ij> create table t(x int);
0 rows inserted/updated/deleted
ij> insert into t values 1, 2;
2 rows inserted/updated/deleted
ij> -- the next statement fails because of overflow (expected)
alter table t add column y smallint generated always as (30000 * x);
ERROR 22003: The resulting value is outside the range for the data type SMALLINT.
ij> -- the next statement fails runs into an assert failure
alter table t add column z int;
ERROR XJ001: Java exception: 'ASSERT FAILED column_id = 1format_ids.length = 2format_ids = [I@2b4c1d96: org.apache.derby.shared.common.sanity.AssertFailure'.
{noformat}

With production jars I see a different error:

{noformat}
ij> autocommit off;
ij> create table t(x int);
0 rows inserted/updated/deleted
ij> insert into t values 1, 2;
2 rows inserted/updated/deleted
ij> -- the next statement fails because of overflow (expected)
alter table t add column y smallint generated always as (30000 * x);
ERROR 22003: The resulting value is outside the range for the data type SMALLINT.
ij> -- the next statement fails runs into an assert failure
alter table t add column z int;
ERROR XSCH5: In a base table there was a mismatch between the requested column number 1 and the maximum number of columns 2.
{noformat}

It looks as if the first, failing ALTER TABLE statement is only partially rolled back, so that there is a half-created column in the table.

> Assert failure when retrying failed ADD COLUMN statement
> --------------------------------------------------------
>
>                 Key: DERBY-6578
>                 URL: https://issues.apache.org/jira/browse/DERBY-6578
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.10.2.0
>            Reporter: Knut Anders Hatlen
>
> I see an assert failure when running this script:
> {code:sql}
> connect 'jdbc:derby:memory:db;create=true';
> autocommit off;
> create table t(x int);
> insert into t values 1, 2;
> -- the next statement fails because of overflow (expected)
> alter table t add column y smallint generated always as (30000 * x);
> -- the next statement fails runs into an assert failure
> alter table t add column z int;
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)