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

MERGE DELETE on table with unique index fails with error 4002

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.3
    • sql-cmp
    • None

    Description

      The following session illustrates the problem:

      >>drop table if exists t1 cascade;

      --- SQL operation complete.
      >>
      >>create table t1 (c1 int not null, c2 int, primary key (c1), unique (c2));

      --- SQL operation complete.
      >>insert into t1 values (1,1),(2,2),(3,3);

      --- 3 row(s) inserted.
      >>
      >>merge into t1 on c2=1 when matched then delete;

      *** ERROR[4002] Column "NEW@".C2 is not found. Table "NEW@" not exposed. Tables in scope: "OLD@". Default schema: TRAFODION.SEABASE.

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

      If the "unique" constraint is absent in the CREATE TABLE statement, the MERGE statement completes successfully.

       

      Attachments

        Issue Links

          Activity

            People

              dbirdsall Dave Birdsall
              dbirdsall Dave Birdsall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: