@@ -337,7 +337,6 @@ void testGetMetadata(String sql, int colCountBeforeExecution, Object[] values,
337337 Assert .assertEquals (metadataRs .getColumnCount (), colCountBeforeExecution );
338338
339339 for (int i = 1 ; i <= metadataRs .getColumnCount (); i ++) {
340- System .out .println ("label=" + metadataRs .getColumnName (i ) + " type=" + metadataRs .getColumnType (i ));
341340 assertEquals (metadataRs .getSchemaName (i ), stmt .getConnection ().getSchema ());
342341 }
343342
@@ -353,7 +352,6 @@ void testGetMetadata(String sql, int colCountBeforeExecution, Object[] values,
353352 assertNotNull (metadataRs );
354353 assertEquals (metadataRs .getColumnCount (), colCountAfterExecution );
355354 for (int i = 1 ; i <= metadataRs .getColumnCount (); i ++) {
356- System .out .println ("label=" + metadataRs .getColumnName (i ) + " type=" + metadataRs .getColumnType (i ));
357355 assertEquals (metadataRs .getSchemaName (i ), stmt .getConnection ().getSchema ());
358356 }
359357 }
@@ -503,7 +501,10 @@ void testMetabaseBug01() throws Exception {
503501 void testStatementSplit () throws Exception {
504502 try (Connection conn = getJdbcConnection ()) {
505503 try (Statement stmt = conn .createStatement ()) {
506- stmt .execute ("CREATE TABLE `with_complex_id` (`v?``1` Int32, \" v?\" \" 2\" Int32,`v?\\ `3` Int32, \" v?\\ \" 4\" Int32) ENGINE Memory;" );
504+ stmt .execute ("CREATE TABLE IF NOT EXISTS `with_complex_id` (`v?``1` Int32, " +
505+ "\" v?\" \" 2\" Int32,`v?\\ `3` Int32, \" v?\\ \" 4\" Int32) ENGINE MergeTree ORDER BY ();" );
506+ stmt .execute ("CREATE TABLE IF NOT EXISTS `test_stmt_split2` (v1 Int32, v2 String) ENGINE MergeTree ORDER BY (); " );
507+ stmt .execute ("INSERT INTO `test_stmt_split2` VALUES (1, 'abc'), (2, '?'), (3, '?')" );
507508 }
508509 String insertQuery = "-- line comment1 ?\n "
509510 + "# line comment2 ?\n "
@@ -536,6 +537,20 @@ void testStatementSplit() throws Exception {
536537 assertEquals (rs .getString (7 ), "test string3 ?\\ " );
537538 }
538539 }
540+
541+ try (PreparedStatement stmt = conn .prepareStatement ("SELECT v1 FROM `test_stmt_split2` WHERE v1 > ? AND v2 = '?'" )) {
542+ stmt .setInt (1 , 2 );
543+ try (ResultSet rs = stmt .executeQuery ()) {
544+ int count = 0 ;
545+ while (rs .next ()) {
546+ count ++;
547+ assertEquals (rs .getInt (1 ), 3 );
548+ }
549+
550+ Assert .assertEquals (count , 1 );
551+ }
552+ }
553+
539554 }
540555 }
541556}
0 commit comments