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

LP Bug: 1384485 - Alter table allows adding a constraint to a _MD_ table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • None
    • sql-cmu
    • None

    Description

      Alter table does not return an error when the user tries to add a constraint to a MD table, although it’s hard to tell if the constraint is actually added or the statement simply aborts internally without returning an error to the user.

      This is seen on the v1021_0830 build installed on a workstation.

      -------------------------------------------------------------------------
      Here is the entire script to reproduce this problem

      showddl "MD".views_usage;
      alter table "MD".views_usage add constraint c1 check (used_object_uid != 0);
      showddl "MD".views_usage;

      -------------------------------------------------------------------------
      Here is the execution output:

      >>showddl "MD".views_usage;

      CREATE TABLE TRAFODION."MD".VIEWS_USAGE
      (
      USING_VIEW_UID LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
      , USED_OBJECT_UID LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
      , USED_OBJECT_TYPE CHAR(2) CHARACTER SET ISO88591 COLLATE
      DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
      , PRIMARY KEY (USING_VIEW_UID ASC, USED_OBJECT_UID ASC)
      )
      ;

      — SQL operation complete.
      >>alter table "MD".views_usage add constraint c1 check (used_object_uid != 0);

      — SQL operation complete.
      >>showddl "MD".views_usage;

      CREATE TABLE TRAFODION."MD".VIEWS_USAGE
      (
      USING_VIEW_UID LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
      , USED_OBJECT_UID LARGEINT NO DEFAULT NOT NULL NOT DROPPABLE
      , USED_OBJECT_TYPE CHAR(2) CHARACTER SET ISO88591 COLLATE
      DEFAULT NO DEFAULT NOT NULL NOT DROPPABLE
      , PRIMARY KEY (USING_VIEW_UID ASC, USED_OBJECT_UID ASC)
      )
      ;

      — SQL operation complete.

      Attachments

        Activity

          People

            rmarton Roberta Marton
            WTsai Weishiun Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: