Skip to content

Commit

Permalink
Trying to debug github tests with print stmt since I can't repro locally
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jf committed Jul 23, 2024
1 parent d128744 commit 91699f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/java/net/snowflake/client/jdbc/PreparedMultiStmtIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ public class PreparedMultiStmtIT extends BaseJDBCWithSharedConnectionIT {

@Before
public void setSessionResultFormat() throws SQLException {
System.out.println("sfConnection is closed? " + sfConnectionV1.isClosed());
try (Statement stmt = connection.createStatement()) {
stmt.execute("alter session set jdbc_query_result_format = '" + queryResultFormat + "'");
}
System.out.println("sfConnection is closed after? " + sfConnectionV1.isClosed());
}

@Test
public void testExecuteUpdateCount() throws Exception {
System.out.println("sfConnection is closed in test? " + sfConnectionV1.isClosed());
try (Statement statement = sfConnectionV1.createStatement()) {
try {
statement.execute("alter session set MULTI_STATEMENT_COUNT=0");
Expand Down Expand Up @@ -71,11 +74,13 @@ public void testExecuteUpdateCount() throws Exception {
statement.execute("drop table if exists test_multi_bind");
}
}
System.out.println("sfConnection is closed after test? " + sfConnectionV1.isClosed());
}

/** Less bindings than expected in statement */
@Test
public void testExecuteLessBindings() throws Exception {
System.out.println("sfConnection is closed in test? " + sfConnectionV1.isClosed());
try (Statement statement = sfConnectionV1.createStatement()) {
try {
statement.execute("alter session set MULTI_STATEMENT_COUNT=0");
Expand Down Expand Up @@ -104,10 +109,12 @@ public void testExecuteLessBindings() throws Exception {
statement.execute("drop table if exists test_multi_bind");
}
}
System.out.println("sfConnection is closed after test? " + sfConnectionV1.isClosed());
}

@Test
public void testExecuteMoreBindings() throws Exception {
System.out.println("sfConnection is closed in test? " + sfConnectionV1.isClosed());
try (Statement statement = sfConnectionV1.createStatement()) {
try {
statement.execute("alter session set MULTI_STATEMENT_COUNT=0");
Expand Down Expand Up @@ -150,10 +157,12 @@ public void testExecuteMoreBindings() throws Exception {
statement.execute("drop table if exists test_multi_bind");
}
}
System.out.println("sfConnection is closed after test? " + sfConnectionV1.isClosed());
}

@Test
public void testExecuteQueryBindings() throws Exception {
System.out.println("sfConnection is closed in test? " + sfConnectionV1.isClosed());
try (Statement statement = sfConnectionV1.createStatement()) {
statement.execute("alter session set MULTI_STATEMENT_COUNT=0");

Expand Down Expand Up @@ -192,10 +201,12 @@ public void testExecuteQueryBindings() throws Exception {
}
}
}
System.out.println("sfConnection is closed after test? " + sfConnectionV1.isClosed());
}

@Test
public void testExecuteQueryNoBindings() throws Exception {
System.out.println("sfConnection is closed in test? " + sfConnectionV1.isClosed());
try (Statement statement = sfConnectionV1.createStatement()) {
statement.execute("alter session set MULTI_STATEMENT_COUNT=0");

Expand Down Expand Up @@ -228,5 +239,6 @@ public void testExecuteQueryNoBindings() throws Exception {
}
}
}
System.out.println("sfConnection is closed after test? " + sfConnectionV1.isClosed());
}
}

0 comments on commit 91699f5

Please sign in to comment.