You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:20:24 UTC

[jira] [Created] (TRAFODION-1203) LP Bug: 1448257 - Volatile table with IDENTITY column can’t be inserted with column list

Alice Chen created TRAFODION-1203:
-------------------------------------

             Summary: LP Bug: 1448257 - Volatile table with IDENTITY column can’t be inserted with column list
                 Key: TRAFODION-1203
                 URL: https://issues.apache.org/jira/browse/TRAFODION-1203
             Project: Apache Trafodion
          Issue Type: Bug
          Components: sql-exe
            Reporter: Weishiun Tsai
            Assignee: Anoop Sharma
            Priority: Critical
             Fix For: 2.0-incubating


When a table is defined with an IDENTITY column, a row can be inserted with a tuple list using DEFAULT as the IDNTITY column value, or with a column list leaving out the IDENTITY column.   With a volatile table, the latter method fails now with error 4193 and 2006.

As shown in the following example, a volatile table t was defined with 3 columns c1, c2, c3.  C1 was declared as an IDENTITY column.  The first 2 inserts used DEFAULT in the tuple list and they worked fine.   The following 2 inserts used a column list specifying c2 and c3.  They both failed with error 4193 and 2006.

This is seen on the v1.1.0rc2 (v0422) build.

--------------------------------------------------------------

Here is the entire script to reproduce it:

create schema mytest;
set schema mytest;

create volatile table t (
c1 largeint GENERATED ALWAYS AS IDENTITY,
c2 int,
c3 smallint);

insert into t values (DEFAULT,1,1);
insert into t values (DEFAULT,2,2);
insert into t (c2, c3) values (3,3);
insert into t (c2, c3) values (4,4);
select * from t;

drop schema mytest cascade;

--------------------------------------------------------------

Here is the execution output:

>>create schema mytest;

--- SQL operation complete.
>>set schema mytest;

--- SQL operation complete.
>>
>>create volatile table t (
+>c1 largeint GENERATED ALWAYS AS IDENTITY,
+>c2 int,
+>c3 smallint);

--- SQL operation complete.
>>
>>insert into t values (DEFAULT,1,1);

--- 1 row(s) inserted.
>>insert into t values (DEFAULT,2,2);

--- 1 row(s) inserted.
>>insert into t (c2, c3) values (3,3);

*** ERROR[4193] The schema name prefix VOLATILE_SCHEMA_ is reserved and cannot be used.

*** ERROR[2006] Internal error: assertion failure (defaultValueExpr) in file ../optimizer/BindRelExpr.cpp at line 9781.

*** ERROR[8822] The statement was not prepared.

>>insert into t (c2, c3) values (4,4);

*** ERROR[4193] The schema name prefix VOLATILE_SCHEMA_ is reserved and cannot be used.

*** ERROR[2006] Internal error: assertion failure (defaultValueExpr) in file ../optimizer/BindRelExpr.cpp at line 9781.

*** ERROR[8822] The statement was not prepared.

>>select * from t;

C1                    C2           C3
--------------------  -----------  ------

                   1            1       1
                   2            2       2

--- 2 row(s) selected.
>>
>>drop schema mytest cascade;

--- SQL operation complete.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)