db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Myrna van Lunteren (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6587) Foreign Key constraint not matched when using UUID in a composite foreign key
Date Thu, 05 Jun 2014 22:47:02 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Myrna van Lunteren updated DERBY-6587:
--------------------------------------

    Attachment: DERBY-6587_tst.diff2

Attaching a second version of the patch.
The difference from the first one is that the test is now called 'Derby6587Test' (adding the
word 'Test') and that the *csv files are now living under functionTests/testData.
Without the fix, the test now puts out this output:
1) testBulkImport(org.apache.derbyTesting.functionTests.tests.lang.Derby6587Test)junit.framework.AssertionFailedError:
caught SQLException: XIE0R; Import error on line 3 of file extin/Derby6587_TABLE2_T.csv: INSERT
on table 'TABLE2_T' caused a violation of foreign key constraint 'FK_1' for key (20000000000000000000000000000000,1).
 The statement has been rolled back.
        at org.apache.derbyTesting.functionTests.tests.lang.Derby6587Test.testBulkImport(Derby6587Test.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:118)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:440)
        at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:457)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
        at junit.extensions.TestSetup.run(TestSetup.java:25)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

I will commit this patch shortly, then apply the fix and add the test to the suites in a next
step.

> Foreign Key constraint not matched when using UUID in a composite foreign key
> -----------------------------------------------------------------------------
>
>                 Key: DERBY-6587
>                 URL: https://issues.apache.org/jira/browse/DERBY-6587
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.10.2.0
>         Environment: Windows 7, Java 7
>            Reporter: Pascal GrĂ¼n
>            Assignee: Myrna van Lunteren
>         Attachments: DERBY-6587_tst.diff, DERBY-6587_tst.diff2, RIBulkChecker.diff, TABLE1_T.csv,
TABLE2_T.csv, schema.sql
>
>
> 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 ..."



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message