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

Hans Zeller resolved TRAFODION-2021.
------------------------------------
       Resolution: Fixed
    Fix Version/s: 2.1-incubating

> Upsert returns compiler internal error 2235 when index includes primary key
> ---------------------------------------------------------------------------
>
>                 Key: TRAFODION-2021
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2021
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-cmp
>    Affects Versions: 2.0-incubating
>            Reporter: Weishiun Tsai
>            Assignee: Hans Zeller
>             Fix For: 2.1-incubating
>
>
> As shown below, t2 and t3 were almost identical except for the primary key a 
> in t3. Same indexes on (a, b) were created on both t2 and t3 prior to the 
> data loading on both tables. Upsert using load worked fine on t2, but it 
> returned compiler internal error on t3.
> >>set parserflags 1;
>  --- SQL operation complete.
>  >>create table t1 (a int not null not droppable primary key, b int, c int);
>  --- SQL operation complete.
>  >>insert into t1 values (1,1,1),(2,2,2),(3,3,3);
>  --- 3 row(s) inserted.
>  >>
>  >>create table t2 (a int not null not droppable, b int, c int);
>  --- SQL operation complete.
>  >>create index myidx2 on t2 (a, b);
>  --- SQL operation complete.
>  >>upsert using load into t2 select * from t1 where a <=2;
>  --- 2 row(s) inserted.
>  >>select count(*) from table(index_table myidx2);
>  (EXPR)
>  --------------------
>                     2
>  --- 1 row(s) selected.
>  >>
>  >>create table t3 (a int not null not droppable primary key, b int, c int);
>  --- SQL operation complete.
>  >>create index myidx3 on t3 (a, b);
>  --- SQL operation complete.
>  >>upsert using load into t3 select * from t1 where a <=2;
>  *** ERROR[7000] An internal error occurred in the code generator in file 
> ../generator/GenPreCode.cpp at line 1317: valuesToBeBound.isEmpty().
>  *** ERROR[2235] Compiler Internal Error: An unknown error, originated from 
> file ../generator/Generator.cpp at line 2872.
>  *** ERROR[8822] The statement was not prepared.
>  >>select count(*) from table(index_table myidx3);
>  (EXPR)
>  --------------------
>                     0
>  --- 1 row(s) selected.
>  >>
>  >>drop table t1 cascade;
>  --- SQL operation complete.
>  >>drop table t2 cascade;
>  --- SQL operation complete.
>  >>drop table t3 cascade;
>  --- SQL operation complete.
> -------------------------------------------------------------------------------------
> Here is the entire script to reproduce this problem:
>  set parserflags 1;
>  create table t1 (a int not null not droppable primary key, b int, c int);
>  insert into t1 values (1,1,1),(2,2,2),(3,3,3);
>  create table t2 (a int not null not droppable, b int, c int);
>  create index myidx2 on t2 (a, b);
>  upsert using load into t2 select * from t1 where a <=2;
>  select count(*) from table(index_table myidx2);
>  create table t3 (a int not null not droppable primary key, b int, c int);
>  create index myidx3 on t3 (a, b);
>  upsert using load into t3 select * from t1 where a <=2;
>  select count(*) from table(index_table myidx3);
>  drop table t1 cascade;
>  drop table t2 cascade;
>  drop table t3 cascade;



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

Reply via email to