DBZ-912 Upgrading to Postgres driver 42.2.5

This commit is contained in:
Gunnar Morling 2018-09-19 10:40:34 +02:00 committed by Jiri Pechanec
parent 00a3c3c8ad
commit f9ede861ba
3 changed files with 10 additions and 8 deletions

View File

@ -215,16 +215,18 @@ public boolean dropReplicationSlot(String slotName) {
try {
execute("select pg_drop_replication_slot('" + slotName + "')");
return true;
} catch (SQLException e) {
}
catch (SQLException e) {
// slot is active
PSQLState currentState = new PSQLState(e.getSQLState());
if (PSQLState.OBJECT_IN_USE.equals(currentState)) {
if (PSQLState.OBJECT_IN_USE.getState().equals(e.getSQLState())) {
LOGGER.warn("Cannot drop replication slot '{}' because it's still in use", slotName);
return false;
} else if (PSQLState.UNDEFINED_OBJECT.equals(currentState)) {
}
else if (PSQLState.UNDEFINED_OBJECT.getState().equals(e.getSQLState())) {
LOGGER.debug("Replication slot {} has already been dropped", slotName);
return false;
} else {
}
else {
LOGGER.error("Unexpected error while attempting to drop replication slot", e);
}
return false;

View File

@ -165,7 +165,7 @@ public void shouldSupportSSLParameters() throws Exception {
assertThat(error).isInstanceOf(ConnectException.class);
Throwable cause = error.getCause();
assertThat(cause).isInstanceOf(SQLException.class);
assertThat(PSQLState.CONNECTION_REJECTED).isEqualTo(new PSQLState(((SQLException)cause).getSQLState()));
assertThat(PSQLState.CONNECTION_REJECTED.getState().equals(((SQLException)cause).getSQLState()));
}
});
if (TestHelper.shouldSSLConnectionFail()) {

View File

@ -66,7 +66,7 @@
<version.confluent.platform>5.0.0</version.confluent.platform>
<!-- Databases -->
<version.postgresql.driver>42.0.0-SNAPSHOT</version.postgresql.driver>
<version.postgresql.driver>42.2.5</version.postgresql.driver>
<version.mysql.server>5.7</version.mysql.server>
<version.mysql.driver>8.0.12</version.mysql.driver>
<version.mysql.binlog>0.16.1</version.mysql.binlog>
@ -238,7 +238,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.0.0</version>
<version>${version.postgresql.driver}</version>
</dependency>
<!--Make sure this version is compatible with the Protbuf-C version used on the server -->