From f9d21eedda8b839541f4304dd4940690eb59a150 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Wed, 2 Oct 2024 12:39:29 +0200 Subject: [PATCH] [jOOQ/jOOQ#9574] The PUBLIC pseudo schema should be invisible Otherwise, the default catalog will report two distinct default schemas, with all the side effects that ensue --- jOOQ/src/main/java/org/jooq/impl/Interpreter.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Interpreter.java b/jOOQ/src/main/java/org/jooq/impl/Interpreter.java index 43bceebb49..3a6f90af08 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Interpreter.java +++ b/jOOQ/src/main/java/org/jooq/impl/Interpreter.java @@ -174,8 +174,8 @@ final class Interpreter { this.locale = interpreterLocale(configuration.settings()); this.defaultCatalog = new MutableCatalog(NO_NAME); this.catalogs.put(defaultCatalog.name(), defaultCatalog); - this.defaultSchema = new MutableSchema(NO_NAME, defaultCatalog); - this.publicSchema = new MutableSchema(NO_NAME, defaultCatalog); + this.defaultSchema = new MutableSchema(NO_NAME, defaultCatalog, true); + this.publicSchema = new MutableSchema(NO_NAME, defaultCatalog, false); } final Meta meta() { @@ -1456,7 +1456,7 @@ final class Interpreter { MutableSchema schema = defaultSchema; if ((schema = find(catalog.schemas, input)) == null && create) // TODO createSchemaIfNotExists should probably be configurable - schema = new MutableSchema((UnqualifiedName) input.getUnqualifiedName(), catalog); + schema = new MutableSchema((UnqualifiedName) input.getUnqualifiedName(), catalog, true); return schema; } @@ -1801,11 +1801,13 @@ final class Interpreter { - MutableSchema(UnqualifiedName name, MutableCatalog catalog) { + MutableSchema(UnqualifiedName name, MutableCatalog catalog, boolean visible) { super(name); this.catalog = catalog; - this.catalog.schemas.add(this); + + if (visible) + this.catalog.schemas.add(this); } @Override