Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5333

Complex foreign keys set the referenced key regardless of order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.3, 10.1.4, 10.2.2
    • None
    • Query Engine
    • None

      The metadatavalidator will resolve foreign keys as long as the columns match - but does not reorder the fk columns nor track the referenced order which means that the referenced key can be wrong. For example:

      CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 integer, PRIMARY KEY(g1e1, g1e2));
      CREATE FOREIGN TABLE G2(g2e1 integer, g2e2 integer, FOREIGN KEY (g2e1, g2e2) REFERENCES G1(g1e2, g1e1));
      

      Note that the elements are reversed in the references list, but this is not captured in the resolved foreign key meaning that it effectively represents a relationship on g2e1,g2e2 with g1e1,g1e2.

              rhn-engineering-shawkins Steven Hawkins
              rhn-engineering-shawkins Steven Hawkins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: