Skip to content

Commit

Permalink
Split preparedThreshold test into 2 tests (thresholds 5 and 0).
Browse files Browse the repository at this point in the history
  • Loading branch information
scubasau committed Nov 25, 2016
1 parent 60a9a41 commit bc2b605
Showing 1 changed file with 10 additions and 3 deletions.
Expand Up @@ -992,7 +992,7 @@ public void testStatementDescribe() throws SQLException {
}

@Test
public void testBatchWithPrepareThreshold() throws SQLException {
public void testBatchWithPrepareThreshold5() throws SQLException {
assumeBinaryModeRegular();
Assume.assumeTrue("simple protocol only does not support prepared statement requests",
preferQueryMode != PreferQueryMode.SIMPLE);
Expand All @@ -1019,8 +1019,15 @@ public void testBatchWithPrepareThreshold() throws SQLException {
assertEquals(1, rs.getInt(1));
rs.close();
pstmt.close();
}

pstmt = con.prepareStatement("CREATE temp TABLE batch_tab_threshold0 (id bigint, val bigint)");
@Test
public void testBatchWithPrepareThreshold0() throws SQLException {
assumeBinaryModeRegular();
Assume.assumeTrue("simple protocol only does not support prepared statement requests",
preferQueryMode != PreferQueryMode.SIMPLE);

PreparedStatement pstmt = con.prepareStatement("CREATE temp TABLE batch_tab_threshold0 (id bigint, val bigint)");
pstmt.executeUpdate();
pstmt.close();

Expand All @@ -1037,7 +1044,7 @@ public void testBatchWithPrepareThreshold() throws SQLException {
}
pstmt.close();
pstmt = con.prepareStatement("select count(*) from pg_prepared_statements where statement = 'INSERT INTO batch_tab_threshold0 (id, val) VALUES ($1,$2)'");
rs = pstmt.executeQuery();
ResultSet rs = pstmt.executeQuery();
assertTrue(rs.next());
assertEquals(0, rs.getInt(1));
rs.close();
Expand Down

0 comments on commit bc2b605

Please sign in to comment.