[ https://issues.apache.org/jira/browse/TRAFODION-1524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15380784#comment-15380784 ]
liu ming commented on TRAFODION-1524: ------------------------------------- fixed by some other changes, not reproducible now. > UPSERT failure with generator error > ----------------------------------- > > Key: TRAFODION-1524 > URL: https://issues.apache.org/jira/browse/TRAFODION-1524 > Project: Apache Trafodion > Issue Type: Bug > Components: sql-cmp > Affects Versions: 1.2-incubating > Environment: Workstation development environment > Reporter: David Wayne Birdsall > Assignee: liu ming > > The following log shows an UPSERT statement that fails in the generator. The > target table has an index on a non-key column, and the UPSERT statement has a > BETWEEN predicate on that same column. Take away either of these conditions > and the failure goes away. > >>obey TestBadUpsert(setup1); > >>drop table if exists T1; > --- SQL operation complete. > >>drop table if exists T1backup; > --- SQL operation complete. > >> > >>create table T1 > +> ( a integer not null, > +> b integer not null, > +> c integer not null, > +> d char(80), > +> primary key (a) ) > +>salt using 4 partitions; > --- SQL operation complete. > >> > >> > >>insert into T1 values (1,1,1,'hi there!'), > +> (2,1,1,'a somewhat longer string'), > +> (3,2,2,'Now is the time for all good men to come to the aid of their > country > .'), > +> (4,3,3,' '); > --- 4 row(s) inserted. > >> > >> > >>-- create another table just like T1 > >>create table T1backup like T1; > --- SQL operation complete. > >> > >>insert into T1backup select * from T1; > --- 4 row(s) inserted. > >> > >>obey TestBadUpsert(setup2); > >> > >>create index iT1b on T1(b); > --- SQL operation complete. > >> > >>obey TestBadUpsert(badupsert); > >> > >>-- this upsert fails. Taking out the "between" (say, replacing > >>-- it with an equality predicate) eliminates the failure. > >>-- Taking out the index on b also eliminates the failure. > >>upsert into T1 select * from T1backup where b between 1 and 2; > *** ERROR[7000] An internal error occurred in the code generator in file > ../gene > rator/GenPreCode.cpp at line 1313: valuesToBeBound.isEmpty(). > *** ERROR[2235] Compiler Internal Error: An unknown error, originated from > file > ../generator/Generator.cpp at line 2810. > *** ERROR[8822] The statement was not prepared. > >> -- This message was sent by Atlassian JIRA (v6.3.4#6332)