Skip to content

Commit 4c77f3b

Browse files
author
Paultagoras
committed
Update PreparedStatementTest.java
1 parent 1cf1f80 commit 4c77f3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jdbc-v2/src/test/java/com/clickhouse/jdbc/PreparedStatementTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ public void testPrimitiveArrays() throws Exception {
234234
try (ResultSet rs = stmt.executeQuery()) {
235235
assertTrue(rs.next());
236236
assertEquals(((BinaryStreamReader.ArrayValue)((BinaryStreamReader.ArrayValue)rs.getObject(1)).get(0)).get(0), "a");
237+
assertEquals(((BinaryStreamReader.ArrayValue)((BinaryStreamReader.ArrayValue)rs.getObject(1)).get(1)).get(0), "b");
238+
assertEquals(((BinaryStreamReader.ArrayValue)((BinaryStreamReader.ArrayValue)rs.getObject(1)).get(2)).get(0), "c");
237239
assertFalse(rs.next());
238240
}
239241
}
@@ -244,11 +246,13 @@ public void testPrimitiveArrays() throws Exception {
244246
@Test(groups = { "integration" })
245247
public void testEscapeStrings() throws Exception {
246248
try (Connection conn = getJdbcConnection()) {
247-
try (PreparedStatement stmt = conn.prepareStatement("SELECT FALSE OR ? = 'test'")) {
248-
stmt.setString(1, "test\\\\' OR 1 = 1 --");
249+
try (PreparedStatement stmt = conn.prepareStatement("SELECT FALSE OR ? = 'test', ?")) {
250+
stmt.setString(1, "test\\' OR 1 = 1 --");
251+
stmt.setString(2, "test\\\\' OR 1 = 1 --");
249252
try (ResultSet rs = stmt.executeQuery()) {
250253
assertTrue(rs.next());
251254
assertEquals(rs.getString(1), "false");
255+
assertEquals(rs.getString(2), "test\\\\' OR 1 = 1 --");
252256
assertFalse(rs.next());
253257
}
254258
}

0 commit comments

Comments
 (0)