Skip to content

JDBC: Update to pgjdbc 42.7.7 #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ tests/client_tests/stock_jdbc/out
*.iws
.gradle/
tests/client_tests/node-postgres/node_modules
tests/client_tests/stock_jdbc/build
2 changes: 1 addition & 1 deletion tests/client_tests/stock_jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.27.3'
testImplementation 'io.crate:crate-testing:0.12.1'
testImplementation 'org.postgresql:postgresql:42.7.4'
testImplementation 'org.postgresql:postgresql:42.7.7'
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void test_generatedKeyAlwaysReturned() throws Exception {
@Ignore("Not implemented in PostgreSQL JDBC")
public void test_getAttributes() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getAttributes("", "", "", "");
conn.getMetaData().getAttributes(null, null, null, null);
}
}

Expand Down Expand Up @@ -135,15 +135,15 @@ public void test_getClientInfoProperties() throws Exception {
@Ignore("https://github.com/crate/crate/issues/9568")
public void test_getColumnPrivileges() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getColumnPrivileges("", "sys", "summits", "");
var results = conn.getMetaData().getColumnPrivileges(null, "sys", "summits", null);
assertThat(results.next()).isTrue();
}
}

@Test
public void test_getColumns() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getColumns("", "sys", "summits", "");
var results = conn.getMetaData().getColumns(null, "sys", "summits", null);
assertThat(results.next()).isTrue();
assertThat(results.getString(3)).isEqualTo("summits");
assertThat(results.getString(4)).isEqualTo("classification");
Expand All @@ -153,7 +153,7 @@ public void test_getColumns() throws Exception {
@Test
public void test_getCrossReference() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getCrossReference("", "sys", "jobs", "", "sys", "jobs_log");
var results = conn.getMetaData().getCrossReference(null, "sys", "jobs", null, "sys", "jobs_log");
assertThat(results.next()).isFalse();
}
}
Expand Down Expand Up @@ -198,7 +198,7 @@ public void test_getDefaultTransactionIsolation() throws Exception {
@Test
public void test_getExportedKeys() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getExportedKeys("", "sys", "summits");
var results = conn.getMetaData().getExportedKeys(null, "sys", "summits");
assertThat(results.next()).isFalse();
}
}
Expand All @@ -213,15 +213,15 @@ public void test_getExtraNameCharacters() throws Exception {
@Test
public void test_getFunctionColumns() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getFunctionColumns("", "", "substr", "");
var results = conn.getMetaData().getFunctionColumns(null, null, "substr", null);
assertThat(results.next()).isFalse();
}
}

@Test
public void test_getFunctions() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getFunctions("", "", "current_schema");
var results = conn.getMetaData().getFunctions(null, null, "current_schema");
assertThat(results.next()).isTrue();
}
}
Expand All @@ -236,7 +236,7 @@ public void test_getIdentifierQuoteString() throws Exception {
@Test
public void test_getImportedKeys() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getImportedKeys("", "sys", "summits");
var results = conn.getMetaData().getImportedKeys(null, "sys", "summits");
assertThat(results.next()).isFalse();
}
}
Expand All @@ -246,7 +246,7 @@ public void test_getImportedKeys() throws Exception {
// Error: Unknown function: pg_catalog.pg_get_indexdef(tmp.ci_oid, tmp.ordinal_position, false)")
public void test_getIndexInfo() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getIndexInfo("", "sys", "summits", true, true);
var results = conn.getMetaData().getIndexInfo(null, "sys", "summits", true, true);
assertThat(results.next()).isFalse();
}
}
Expand Down Expand Up @@ -409,15 +409,16 @@ public void tes_getNumericFunctions() throws Exception {
@Test
public void test_getPrimaryKeys() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
ResultSet results = conn.getMetaData().getPrimaryKeys(null, null, null);
var results = conn.getMetaData().getPrimaryKeys(null, null, null);
assertThat(results.next()).isTrue();
}
}

@Test
public void test_getProcedureColumns() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getProcedureColumns("", "", "", "");
var results = conn.getMetaData().getProcedureColumns(null, null, null, null);
assertThat(results.next()).isTrue();
}
}

Expand All @@ -431,15 +432,16 @@ public void test_getProcedureTerm() throws Exception {
@Test
public void test_getProcedures() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getProcedures("", "", "");
var results = conn.getMetaData().getProcedures(null, null, null);
assertThat(results.next()).isFalse();
}
}

@Test
@Ignore("Not implemented by PostgreSQL JDBC")
public void test_getPseudoColumns() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getPseudoColumns("", "sys", "summits", "m");
conn.getMetaData().getPseudoColumns(null, "sys", "summits", "m");
}
}

Expand Down Expand Up @@ -507,15 +509,15 @@ public void test_getStringFunctions() throws Exception {
@Ignore("Not implemented in PostgreSQL JDBC")
public void test_getSuperTables() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getSuperTables("", "sys", "summits");
conn.getMetaData().getSuperTables(null, "sys", "summits");
}
}

@Test
@Ignore("Not implemented in PostgreSQL JDBC")
public void test_getSuperTypes() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getSuperTypes("", "sys", "t");
conn.getMetaData().getSuperTypes(null, "sys", "t");
}
}

Expand All @@ -529,7 +531,8 @@ public void test_getSystemFunctions() throws Exception {
@Test
public void test_getTablePrivileges() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getTablePrivileges("", "sys", "summits");
var results = conn.getMetaData().getTablePrivileges(null, "sys", "summits");
assertThat(results.next()).isFalse();
}
}

Expand All @@ -544,7 +547,7 @@ public void test_getTableTypes() throws Exception {
@Test
public void test_getTables() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getTables(null, "sys", "", null);
var results = conn.getMetaData().getTables(null, "sys", null, null);
assertThat(results.next()).isTrue();
assertThat(results.getString(3)).isEqualTo("allocations_pkey");
}
Expand All @@ -561,21 +564,23 @@ public void test_getTimeDateFunctions() throws Exception {
@Test
public void test_getTypeInfo() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getTypeInfo();
var results = conn.getMetaData().getTypeInfo();
assertThat(results.next()).isTrue();
}
}

@Test
public void test_getUDTs() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
conn.getMetaData().getUDTs("", "sys", "t", new int[0]);
var results = conn.getMetaData().getUDTs(null, "sys", "t", new int[0]);
assertThat(results.next()).isFalse();
}
}

@Test
public void test_getVersionColumns() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var results = conn.getMetaData().getVersionColumns("", "sys", "summits");
var results = conn.getMetaData().getVersionColumns(null, "sys", "summits");
assertThat(results.next()).isTrue();
assertThat(results.getString(2)).isEqualTo("ctid");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stock_jdbc;

import io.crate.testing.CrateTestCluster;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -22,8 +22,8 @@ public class JdbcTest {
.build();
public static final String URL = "jdbc:postgresql://localhost:55433/doc?user=crate";

@After
public void after() throws Exception {
@Before
public void before() throws Exception {
try (var conn = DriverManager.getConnection(URL)) {
var tables = conn.getMetaData().getTables(null, "doc", null, null);
while (tables.next()) {
Expand Down