File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
jdbc-v2/src/test/java/com/clickhouse/jdbc Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments