Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-5118

Relational integrity

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
    • Environment:
      WinXPpro@32bit, Apache Derby EMBEDDED
    • Urgency:
      Normal

      Description

      A foreign composite key constraint doesn't match the corresponding primary composite key unless the order of the columns that make up the composite key is the same.

      E.g.:
      Given a table called "icone" with the following primary key: "CONSTRAINT icone_PK PRIMARY KEY(seticone,idazione)".

      "CONSTRAINT BOTTONE_FK3 foreign key(seticone,idazione) references icone on delete cascade"
      and
      "CONSTRAINT BOTTONE_FK3 foreign key(idazione,seticone) references icone on delete cascade"
      should be the same thing (IMHO) but it's not the same according to Derby.

      The latter syntax is apparently broken and when inserting a new row, in the table that has such constraint, there is an error because Derby swaps the two attributes that make up the composite key and thus the FK constraint cannot be fulfilled.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              unai Unai Vivi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: