[
https://issues.apache.org/jira/browse/DERBY-6623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14041866#comment-14041866
]
Knut Anders Hatlen commented on DERBY-6623:
-------------------------------------------
My expectation would be that it only returned one of them. The javadoc says:
"Retrieves a description of a table's optimal set of columns that uniquely
identifies a row." And (I, J) sounds like a less optimal set than (I) or (J),
since it's bigger and has some redundancy.
I think the current behaviour is fine, but I see no harm in adding some extra
ordering so that it is deterministic which constraint is used in case of ties.
The reference manual actually has [a
topic|https://builds.apache.org/job/Derby-docs/lastSuccessfulBuild/artifact/trunk/out/ref/index.html]
that describes how getBestRowIdentifier() works. It's more detailed than the
JDBC specification, but it does not say anything about ties.
> DatabaseMetaDataTest fails intermittently
> -----------------------------------------
>
> Key: DERBY-6623
> URL: https://issues.apache.org/jira/browse/DERBY-6623
> Project: Derby
> Issue Type: Bug
> Components: Test
> Reporter: Dag H. Wanvik
> Assignee: Dag H. Wanvik
> Fix For: 10.11.0.0
>
> Attachments: derby-6623.diff
>
>
> Saw this on the trunk
> [[http://download.java.net/javadesktop/derby/request_5592737/javadb-task-3883745.html][regression
> tests]]:
> testGetXXportedKeys:
> {code}
> junit.framework.AssertionFailedError: Column value mismatch @ column
> 'FK_NAME', row 3:
> Expected: >FKEY3<
> Found: >FKEY2<
> at
> org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1303)
> at
> org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1215)
> at
> org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.java:1102)
> at
> org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:1025)
> at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:982)
> at
> org.apache.derbyTesting.functionTests.tests.jdbcapi.DatabaseMetaDataTest.assertFullResultSet(DatabaseMetaDataTest.java:3930)
> at
> org.apache.derbyTesting.functionTests.tests.jdbcapi.DatabaseMetaDataTest.testGetXXportedKeys(DatabaseMetaDataTest.java:4117)
> 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)
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)