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

Foreign Key constraint not matched when using UUID in a composite foreign key when using SYSCS_UTIL.SYSCS_IMPORT_TABLE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.10.2.0
    • 10.10.2.1, 10.11.1.1
    • SQL, Tools
    • None
    • Windows 7, Java 7

    Description

      There is a problem in org.apache.derby.impl.sql.execute.RIBulkChecker:

      result = fkCol.compare(refCol);

      if (result == 1)

      { return GREATER_THAN; }

      else if (result == -1)

      { return LESS_THAN; }

      where the JavaDoc for "compare" explicitly states that one must not use 1 or -1 to check the return value.

      The problem can be reproduced when creating a table with two fields, "UUID_FIELD char (16) for bit data" and "NUM_FIELD integer", then having a foreign key to these two fields and then using the bulk import, i.e. "CALL SYSCS_UTIL.SYSCS_IMPORT_TABLE ..."

      Attachments

        1. DERBY-6587_tst.diff
          8 kB
          Myrna van Lunteren
        2. DERBY-6587_tst.diff2
          8 kB
          Myrna van Lunteren
        3. RIBulkChecker.diff
          0.4 kB
          Pascal Grün
        4. schema.sql
          0.5 kB
          Pascal Grün
        5. TABLE1_T.csv
          0.1 kB
          Pascal Grün
        6. TABLE2_T.csv
          0.1 kB
          Pascal Grün

        Issue Links

          Activity

            People

              myrna Myrna van Lunteren
              pascalgruen Pascal Grün
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: