Attempt to resolve foreign key metadata from JDBC metadata failed to find column mappings for foreign key

Description

When a foreign key references a key from another schema, pkTableInformation is always null in InformationExtractorJdbcDatabaseMetaDataImpl#getForeignKeys.

The cause is

1 final QualifiedTableName incomingPkTableName = extractKeyTableName( resultSet, "PK" );

returning a DatabaseIdentifier object, but

1 identifierHelper().toIdentifier( resultSet.getString( "TABLE_NAME" ) ) )

return an Identifier object, then comparation failed in InformationExtractorJdbcDatabaseMetaDataImpl#processGetTableResults

1 if ( tableName.equals( identifierHelper().toIdentifier( resultSet.getString( "TABLE_NAME" ) ) ) ) {

Environment

JDK 1.8

Status

Assignee

Andrea Boriero

Reporter

杨林

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.0

Priority

Critical