cgivre commented on PR #3048: URL: https://github.com/apache/drill/pull/3048#issuecomment-4775116352
I pushed a follow-up commit (`Keep JDBC schemas at top level with postgresql 42.7+`) so this bump can actually pass CI. **Why the bump alone failed:** with 42.4.4 the Postgres tests pass, but bumping to 42.7.11 broke every Postgres storage test with `VALIDATION ERROR: Schema [pg.public] is not valid`. H2/MySQL tests were unaffected. **Root cause:** a `DatabaseMetaData` behavior change in pgjdbc 42.7.x. I reproduced it against a real `postgres:12.8-alpine3.14` container: | Call | 42.4.4 | 42.7.11 | |---|---|---| | `getCatalogs()` | `drill_postgres_test` | `drill_postgres_test, postgres, template1` | | `getSchemas()` → `TABLE_CATALOG` | **`null`** | **`drill_postgres_test`** | `JdbcCatalogSchema.addSchemas()` uses the `TABLE_CATALOG` value to decide nesting: when it's non-null and matches a known catalog, the schema is attached under that catalog. So `public` moved from `pg.public` to `pg.<database>.public` — which fails every query (and the default schema is no longer resolved). This isn't just a test issue: it would silently change the schema paths that existing Drill+Postgres users query. **Fix:** capture the connection's own database via `Connection.getCatalog()` and treat a schema whose `TABLE_CATALOG` equals it the same as a null catalog, keeping it at the top level (`pg.public`). The guard is a no-op for drivers that report a null or non-matching catalog (MySQL, H2, etc.), so existing behavior is preserved. Verified the placement is `pg.public` with both 42.7.11 and 42.4.4. `mvn checkstyle:check` on the module is clean. (Heads-up: since this PR now carries a manual commit, Dependabot will stop rebasing it.) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
