From 27e206f12b50e60e243572db3b6c5c54a113a746 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 9 Jan 2024 22:49:10 +0100 Subject: [PATCH] pgjdbc: Adjust test for updates to `conn.getMetaData().getCatalogs()` As before, the inquiry of the available catalogs returned `doc` on the first slot. It looks actually correct now in 42.7, as `doc` is the schema, but not the catalog. The SQL statement to inquire the available catalogs returns `crate`, not `doc`. SELECT DISTINCT table_catalog FROM information_schema.tables This item on the upstream release notes seems to be relevant: feat: return all catalogs for getCatalogs metadata query closes ISSUE #2949 PR #2953 -- https://jdbc.postgresql.org/changelogs/2023-11-20-42.7.0-release/ --- .../stock_jdbc/src/test/java/stock_jdbc/JdbcMetaDataTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/client_tests/stock_jdbc/src/test/java/stock_jdbc/JdbcMetaDataTest.java b/tests/client_tests/stock_jdbc/src/test/java/stock_jdbc/JdbcMetaDataTest.java index 7538d783..ca903b0e 100644 --- a/tests/client_tests/stock_jdbc/src/test/java/stock_jdbc/JdbcMetaDataTest.java +++ b/tests/client_tests/stock_jdbc/src/test/java/stock_jdbc/JdbcMetaDataTest.java @@ -121,7 +121,8 @@ public void test_getCatalogs() throws Exception { try (var conn = DriverManager.getConnection(URL)) { var result = conn.getMetaData().getCatalogs(); assertThat(result.next(), is(true)); - assertThat(result.getString(1), is("doc")); + // Returns `crate` as of pgjdbc 42.7.0. It returned `doc` before. + assertThat(result.getString(1), is("crate")); } }