Uploaded image for project: 'CUBRID Engine'
  1. CUBRID Engine
  2. ENGINE-117

Foreign Key constraint followed by Unique constraint fails to execute

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: banana
    • Component/s: CUBRID Engine
    • Labels:
      None
    • Environment:

      CUBRID 8.4.3.1005

      Description

      {code}
      DROP TABLE IF EXISTS b;
      DROP TABLE IF EXISTS a;
      CREATE TABLE a (
      field_int INT PRIMARY KEY UNIQUE,
      field_str VARCHAR(32)
      );

      CREATE TABLE b (
      field_int INT PRIMARY KEY UNIQUE,
      foreign_int INT
      );

      ALTER TABLE b ADD FOREIGN KEY(foreign_int) REFERENCES a(field_int);
      CREATE UNIQUE INDEX fk_id2 ON b(foreign_int);{code}

      gives the error:

      {code}
      6'th query failed.
      --------------------------------------------------
      CREATE UNIQUE INDEX fk_id2 ON b(foreign_int);


      execute error: -272
      Index "fk_b_foreign_int" already defined for class "b".{code}

      If the foreign key is created after the unique constraint, then the code works fine (no errors).

      {code}
      CREATE UNIQUE INDEX fk_id2 ON b(foreign_int);
      ALTER TABLE b ADD FOREIGN KEY(foreign_int) REFERENCES a(field_int);{code}

        Activity

        Show
        kadishmal Esen Sagynov added a comment - Reported to http://bts4.nhncorp.com/nhnbts/browse/CUBRIDSUS-11799 .
        Hide
        kadishmal Esen Sagynov added a comment -

        This issue has been previously reported. It's planned to be fixed in Banana.

        Show
        kadishmal Esen Sagynov added a comment - This issue has been previously reported. It's planned to be fixed in Banana.

          People

          • Assignee:
            kadishmal Esen Sagynov
            Reporter:
            ovidiu.veliscu Veliscu Ovidiu
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: