[#6583] Make this work also for aliased target tables
This commit is contained in:
parent
4e2bc62640
commit
eb6952405b
@ -2097,11 +2097,15 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
}
|
||||
|
||||
private final boolean containsTable(Table<?> table, Table<?> contained) {
|
||||
if (table instanceof JoinTable)
|
||||
Table<?> alias;
|
||||
|
||||
if ((alias = Tools.aliased(table)) != null)
|
||||
return containsTable(alias, contained);
|
||||
else if ((alias = Tools.aliased(contained)) != null)
|
||||
return containsTable(table, alias);
|
||||
else if (table instanceof JoinTable)
|
||||
return containsTable(((JoinTable) table).lhs, contained)
|
||||
|| containsTable(((JoinTable) table).rhs, contained);
|
||||
else if (table instanceof TableAlias)
|
||||
return containsTable(((TableAlias<?>) table).alias.wrapped, contained);
|
||||
else
|
||||
return contained.equals(table);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user