|
10 | 10 | //
|
11 | 11 | //===----------------------------------------------------------------------===//
|
12 | 12 |
|
13 |
| - |
14 | 13 | /**
|
15 | 14 | * 1 and 2 tuple, prepared insert statement tests.
|
16 | 15 | */
|
@@ -209,7 +208,31 @@ public void testPS_1Tuple_CS_4() throws SQLException {
|
209 | 208 | new int [] {1, 0, 3});
|
210 | 209 | assertNoMoreRows(rs);
|
211 | 210 | }
|
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 | + |
213 | 236 | /* --------------------------------------------
|
214 | 237 | * 2 tuple insertions
|
215 | 238 | * ---------------------------------------------
|
@@ -431,8 +454,7 @@ public void test_1Tuple_CS_2() throws SQLException {
|
431 | 454 | assertNoMoreRows(rs);
|
432 | 455 | }
|
433 | 456 |
|
434 |
| - |
435 |
| - /* 2 tuple inserts */ |
| 457 | + /* 2 tuple (non-prepared statement) inserts */ |
436 | 458 |
|
437 | 459 | /**
|
438 | 460 | * 2 tuple insert, with no column specification.
|
@@ -460,6 +482,4 @@ public void test_2Tuple_NCS() throws SQLException {
|
460 | 482 |
|
461 | 483 | assertNoMoreRows(rs);
|
462 | 484 | }
|
463 |
| - |
464 |
| - |
465 | 485 | }
|
0 commit comments