Skip to content

Commit

Permalink
fix: Issue pgjdbc#2267, version 14 returns UNDEFINED FUNCTION for tes…
Browse files Browse the repository at this point in the history
…tInvokeFunctionHavingReturnParameter, also add v13, and v14 to Server versions
  • Loading branch information
davecramer committed Sep 27, 2021
1 parent 512799b commit b50cf4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pgjdbc/src/main/java/org/postgresql/core/ServerVersion.java
Expand Up @@ -28,7 +28,9 @@ public enum ServerVersion implements Version {
v9_6("9.6.0"),
v10("10"),
v11("11"),
v12("12")
v12("12"),
v13("13"),
v14("14")
;

private final int version;
Expand Down
Expand Up @@ -11,6 +11,7 @@
import org.postgresql.PGProperty;
import org.postgresql.core.ServerVersion;
import org.postgresql.jdbc.EscapeSyntaxCallMode;
import org.postgresql.test.TestUtil;
import org.postgresql.util.PSQLState;

import org.junit.Test;
Expand Down Expand Up @@ -60,7 +61,12 @@ public void testInvokeFunctionHavingReturnParameter() throws Throwable {
cs.execute();
fail("Should throw an exception");
} catch (SQLException ex) {
assertTrue(ex.getSQLState().equalsIgnoreCase(PSQLState.WRONG_OBJECT_TYPE.getState()));
// version 14 changes this to undefined function
if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v14)) {
assertTrue(ex.getSQLState().equalsIgnoreCase(PSQLState.UNDEFINED_FUNCTION.getState()));
} else {
assertTrue(ex.getSQLState().equalsIgnoreCase(PSQLState.WRONG_OBJECT_TYPE.getState()));
}
}
}

Expand Down

0 comments on commit b50cf4d

Please sign in to comment.