Uploaded image for project: 'Apache Trafodion (Retired)'
  1. Apache Trafodion (Retired)
  2. TRAFODION-229

LP Bug: 1308695 - Indexes caused insert to assert in ../optimizer/BindRelExpr.cpp

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.8 (pre-incubation)
    • sql-cmp
    • None

    Description

      When a table is dropped and recreated with the same name, if indexes were created for the tables, the insert on the second table returns an internal error:

          • ERROR[2006] Internal error: assertion failure (tgtcols.entries() == baseColRefs().entries()) in file ../optimizer/BindRelExpr.cpp at line 11964. [2014-04-16 11:27:30]

      This is seen on the beta v39140 build, both on a workstation, and on the cluster installation.

      Here is the script to reproduce this problem. Following it are 2 execution outputs. The 1st output shows the errors. The 2nd output shows that the insert runs fine if the indexes were not created.

      ==================================================================================================

      Create table T3(F int default null,
      G smallint default null,
      H largeint not null not droppable primary key,
      I numeric(9,3) default null);

      create index num_idx on T3(I);

      insert into T3 values(2, 1,1,1);

      drop table T3 cascade;

      Create table T3(F int not null not droppable ,
      G smallint not null not droppable ,
      H largeint not null not droppable ,
      I numeric(9,3) default null,
      primary key (F,G,H) );

      create index num_idx on T3(I);

      insert into T3 values(2, 1,1,1);
      insert into T3 values(4, 2,2,1);

      ==================================================================================================

      SQL>Create table T3(F int default null,
      +>G smallint default null,
      +>H largeint not null not droppable primary key,
      +>I numeric(9,3) default null);

      — SQL operation complete.

      SQL>create index num_idx on T3(I);

      — SQL operation complete.

      SQL>insert into T3 values(2, 1,1,1);

      — 1 row(s) inserted.

      SQL>drop table T3 cascade;

      — SQL operation complete.

      SQL>Create table T3(F int not null not droppable ,
      +>G smallint not null not droppable ,
      +>H largeint not null not droppable ,
      +>I numeric(9,3) default null,
      +>primary key (F,G,H) );

      — SQL operation complete.

      SQL>create index num_idx on T3(I);

      — SQL operation complete.

      SQL>insert into T3 values(2, 1,1,1);

          • ERROR[2006] Internal error: assertion failure (tgtcols.entries() == baseColRefs().entries()) in file ../optimizer/BindRelExpr.cpp at line 11964. [2014-04-16 11:27:30]

      SQL>insert into T3 values(4, 2,2,1);

          • ERROR[2006] Internal error: assertion failure (tgtcols.entries() == baseColRefs().entries()) in file ../optimizer/BindRelExpr.cpp at line 11964. [2014-04-16 11:27:30]

      ==================================================================================================

      SQL>Create table T3(F int default null,
      +>G smallint default null,
      +>H largeint not null not droppable primary key,
      +>I numeric(9,3) default null);

      — SQL operation complete.

      SQL>-- create index num_idx on T3(I);

      SQL>insert into T3 values(2, 1,1,1);

      — 1 row(s) inserted.

      SQL>drop table T3 cascade;

      — SQL operation complete.

      SQL>Create table T3(F int not null not droppable ,
      +>G smallint not null not droppable ,
      +>H largeint not null not droppable ,
      +>I numeric(9,3) default null,
      +>primary key (F,G,H) );

      — SQL operation complete.

      SQL>-- create index num_idx on T3(I);

      SQL>insert into T3 values(2, 1,1,1);

      — 1 row(s) inserted.

      SQL>insert into T3 values(4, 2,2,1);

      — 1 row(s) inserted.

      Attachments

        Activity

          People

            Unassigned Unassigned
            WTsai Weishiun Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: