The previous fix for TableImpl::equals was incorrect when the schema is qualified with a catalog
This commit is contained in:
Lukas Eder 2020-06-16 15:03:06 +02:00
parent 2592960afe
commit 9a60e71852
2 changed files with 5 additions and 2 deletions

View File

@ -69,6 +69,7 @@ public class SchemaImpl extends AbstractNamed implements Schema {
private static final long serialVersionUID = -8101463810207566546L;
private static final Clause[] CLAUSES = { SCHEMA, SCHEMA_REFERENCE };
static final Schema DEFAULT_SCHEMA = new SchemaImpl("");
private Catalog catalog;

View File

@ -50,7 +50,9 @@ import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.impl.Internal.createPathAlias;
import static org.jooq.impl.Keywords.K_TABLE;
import static org.jooq.impl.QueryPartListView.wrap;
import static org.jooq.impl.SchemaImpl.DEFAULT_SCHEMA;
import static org.jooq.impl.Tools.getMappedTable;
import static org.jooq.tools.StringUtils.defaultIfNull;
import java.util.Arrays;
import java.util.Set;
@ -367,8 +369,8 @@ public class TableImpl<R extends Record> extends AbstractTable<R> {
// [#7172] [#10274] Cannot use getQualifiedName() yet here
StringUtils.equals(
getSchema() == null ? "" : getSchema().getName(),
other.getSchema() == null ? "" : other.getSchema().getName()
defaultIfNull(getSchema(), DEFAULT_SCHEMA),
defaultIfNull(other.getSchema(), DEFAULT_SCHEMA)
) &&
StringUtils.equals(getName(), other.getName()) &&
Arrays.equals(parameters, other.parameters);