Skip to content

Commit 0e2b532

Browse files
committed
Skip a few more tests on 21.3
1 parent 14f856a commit 0e2b532

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

clickhouse-jdbc/src/test/java/com/clickhouse/jdbc/ClickHousePreparedStatementTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.clickhouse.jdbc.internal.SqlBasedPreparedStatement;
3737

3838
import org.testng.Assert;
39+
import org.testng.SkipException;
3940
import org.testng.annotations.DataProvider;
4041
import org.testng.annotations.Test;
4142

@@ -1015,8 +1016,9 @@ public void testInsertDefaultValue(String columnType, String defaultExpr, String
10151016
String tableName = "test_insert_default_value_" + columnType.split("\\(")[0].trim().toLowerCase();
10161017
try (ClickHouseConnection conn = newConnection(props); Statement s = conn.createStatement()) {
10171018
if (conn.getUri().toString().contains(":grpc:")) {
1018-
// skip gRPC tests
1019-
return;
1019+
throw new SkipException("Skip gRPC test");
1020+
} else if (!conn.getServerVersion().check("[21.8,)")) {
1021+
throw new SkipException("Skip test when ClickHouse is older than 21.8");
10201022
}
10211023
s.execute(String.format("drop table if exists %s; ", tableName)
10221024
+ String.format("create table %s(id Int8, v %s DEFAULT %s)engine=Memory", tableName, columnType,
@@ -1053,8 +1055,8 @@ public void testInsertDefaultValue(String columnType, String defaultExpr, String
10531055
}
10541056
Assert.assertEquals(rowCount, 3);
10551057
} catch (SQLException e) {
1056-
// 'Unknown data type family' or 'Missing columns'
1057-
if (e.getErrorCode() == 50 || e.getErrorCode() == 47) {
1058+
// 'Unknown data type family', 'Missing columns' or 'Cannot create table column'
1059+
if (e.getErrorCode() == 50 || e.getErrorCode() == 47 || e.getErrorCode() == 44) {
10581060
return;
10591061
}
10601062
throw e;

clickhouse-jdbc/src/test/java/com/clickhouse/jdbc/ClickHouseResultSetTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.clickhouse.client.data.ClickHouseOffsetDateTimeValue;
2323

2424
import org.testng.Assert;
25+
import org.testng.SkipException;
2526
import org.testng.annotations.DataProvider;
2627
import org.testng.annotations.Test;
2728

@@ -176,6 +177,10 @@ public void testIpAddress() throws SQLException {
176177
public void testMap() throws SQLException {
177178
try (ClickHouseConnection conn = newConnection(new Properties());
178179
Statement stmt = conn.createStatement()) {
180+
if (!conn.getServerVersion().check("[21.8,)")) {
181+
throw new SkipException("Skip test when ClickHouse version is older than 21.8");
182+
}
183+
179184
stmt.execute("drop table if exists test_map_of_array; "
180185
+ "create table test_map_of_array(id Int8, m0 Map(String, Array(Nullable(DateTime64(3)))), m1 Map(String, Array(Nullable(DateTime64(3, 'Asia/Shanghai'))))) ENGINE = Memory; "
181186
+ "insert into test_map_of_array values(1, { 'a' : [], 'b' : [ '2022-03-30 00:00:00.123', null ] }, { 'a' : [], 'b' : [ '2022-03-30 00:00:00.123', null ] })");

0 commit comments

Comments
 (0)