postgresql-jdbc.git / summary / log / commit / refs
commit 90e53cbbf213da67c49f2ddc511b86acd0fb0154
Author: Sehrope Sarkuni <sehrope@jackdb.com>
Date: Tue Jan 25 15:40:16 2022 +0000
test: Disable no-arg callable statement tests in simple query mode
Disables the JDBC function call syntax callable statement tests with no arguments
when running the test suite in simple query mode. The new tests fail with simple
query mode as internal JDBC-to-native query parser generates SQL that contains
the out parameters in the SQL body which is only ignored by the server when
processed in an extended parse, bind, execute sequence. When executed as a simple
query command the server does not ignore the extra parameters and the query
fails.
This commit does not fix anything yet. It simply skips the new failing test in simple
query mode so that the rest of the quite can execute. The behavior of the driver has
not changed in the recent additions either, the new tests simply brought to light an
existing issue with simple query mode.
See #2399 for more details.
pgjdbc/src/test/java/org/postgresql/test/jdbc2/BaseTest4.java | 4 ++++
.../java/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java | 3 +++
2 files changed, 7 insertions(+)
diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/BaseTest4.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/BaseTest4.java
index 56407994..de4b9dd1 100644
--- a/pgjdbc/src/test/java/org/postgresql/test/jdbc2/BaseTest4.java
+++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc2/BaseTest4.java
@@ -109,6 +109,10 @@ public class BaseTest4 {
Assume.assumeTrue(preferQueryMode != PreferQueryMode.SIMPLE);
}
+ public void assumeNotSimpleQueryMode() {
+ Assume.assumeTrue(preferQueryMode != PreferQueryMode.SIMPLE);
+ }
+
/**
* Shorthand for {@code Assume.assumeTrue(TestUtil.haveMinimumServerVersion(conn, version)}.
*/
diff --git a/pgjdbc/src/test/java/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java b/pgjdbc/src/test/java/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java
index 822bdf80..17cf4500 100644
--- a/pgjdbc/src/test/java/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java
+++ b/pgjdbc/src/test/java/org/postgresql/test/jdbc3/Jdbc3CallableStatementTest.java
@@ -395,6 +395,7 @@ public class Jdbc3CallableStatementTest extends BaseTest4 {
@Test
public void testGetBit1WithoutArg() throws SQLException {
+ assumeNotSimpleQueryMode();
try (CallableStatement call = con.prepareCall("{ ? = call testspg__getBit1WithoutArg () }")) {
call.registerOutParameter(1, Types.BOOLEAN);
call.execute();
@@ -404,6 +405,7 @@ public class Jdbc3CallableStatementTest extends BaseTest4 {
@Test
public void testGetBit2WithoutArg() throws SQLException {
+ assumeNotSimpleQueryMode();
try (CallableStatement call = con.prepareCall("{ ? = call testspg__getBit2WithoutArg () }")) {
call.registerOutParameter(1, Types.BOOLEAN);
try {
@@ -980,6 +982,7 @@ public class Jdbc3CallableStatementTest extends BaseTest4 {
@Test
public void testGetBooleanWithoutArg() throws SQLException {
+ assumeNotSimpleQueryMode();
try (CallableStatement call = con.prepareCall("{ ? = call testspg__getBooleanWithoutArg () }")) {
call.registerOutParameter(1, Types.BOOLEAN);
call.execute();
[parent: d281a788b227]