Skip to content

Commit

Permalink
0002947: Auto resolve foreign key violation fails when table in
Browse files Browse the repository at this point in the history
different catalog or schema
  • Loading branch information
mmichalek committed Dec 28, 2016
1 parent ce0fc4d commit d280f9e
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -1598,6 +1598,13 @@ protected List<TableRow> getForeignTableRows(List<TableRow> tableRows, Set<Table
if (visited.add(tableRow)) {
for (ForeignKey fk : tableRow.getTable().getForeignKeys()) {
Table table = platform.getTableFromCache(fk.getForeignTableName(), false);
if (table == null) {
table = fk.getForeignTable();
if (table == null) {
table = platform.getTableFromCache(tableRow.getTable().getCatalog(),
tableRow.getTable().getSchema(), fk.getForeignTableName(), false);
}
}
if (table != null) {
Table foreignTable = (Table) table.clone();
for (Column column : foreignTable.getColumns()) {
Expand Down

0 comments on commit d280f9e

Please sign in to comment.