Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit d983c3c

Browse files
committed
More test updates
1 parent b0ede25 commit d983c3c

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

script/testing/junit/InsertPSTest.java

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
1413
/**
1514
* 1 and 2 tuple, prepared insert statement tests.
1615
*/
@@ -209,7 +208,31 @@ public void testPS_1Tuple_CS_4() throws SQLException {
209208
new int [] {1, 0, 3});
210209
assertNoMoreRows(rs);
211210
}
212-
211+
212+
/**
213+
* Prepared statement, 1 tuple insert, with columns inserted
214+
* in schema order, one constant column
215+
*/
216+
// Works, due to use of insert rather than push back
217+
218+
@Test
219+
public void testPS_1Tuple_CS_5() throws SQLException {
220+
221+
String sql = "INSERT INTO tbl (c1, c2, c3) VALUES (?, 2, ?);";
222+
PreparedStatement pstmt = conn.prepareStatement(sql);
223+
224+
setValues(pstmt, new int [] {1, 3});
225+
pstmt.addBatch();
226+
pstmt.executeBatch();
227+
228+
getResultsPS();
229+
rs.next();
230+
checkRow(rs,
231+
new String [] {"c1", "c2", "c3"},
232+
new int [] {1, 2, 3});
233+
assertNoMoreRows(rs);
234+
}
235+
213236
/* --------------------------------------------
214237
* 2 tuple insertions
215238
* ---------------------------------------------
@@ -431,8 +454,7 @@ public void test_1Tuple_CS_2() throws SQLException {
431454
assertNoMoreRows(rs);
432455
}
433456

434-
435-
/* 2 tuple inserts */
457+
/* 2 tuple (non-prepared statement) inserts */
436458

437459
/**
438460
* 2 tuple insert, with no column specification.
@@ -460,6 +482,4 @@ public void test_2Tuple_NCS() throws SQLException {
460482

461483
assertNoMoreRows(rs);
462484
}
463-
464-
465485
}

0 commit comments

Comments
 (0)