|
36 | 36 | import com.clickhouse.jdbc.internal.SqlBasedPreparedStatement; |
37 | 37 |
|
38 | 38 | import org.testng.Assert; |
| 39 | +import org.testng.SkipException; |
39 | 40 | import org.testng.annotations.DataProvider; |
40 | 41 | import org.testng.annotations.Test; |
41 | 42 |
|
@@ -1015,8 +1016,9 @@ public void testInsertDefaultValue(String columnType, String defaultExpr, String |
1015 | 1016 | String tableName = "test_insert_default_value_" + columnType.split("\\(")[0].trim().toLowerCase(); |
1016 | 1017 | try (ClickHouseConnection conn = newConnection(props); Statement s = conn.createStatement()) { |
1017 | 1018 | 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"); |
1020 | 1022 | } |
1021 | 1023 | s.execute(String.format("drop table if exists %s; ", tableName) |
1022 | 1024 | + 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 |
1053 | 1055 | } |
1054 | 1056 | Assert.assertEquals(rowCount, 3); |
1055 | 1057 | } 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) { |
1058 | 1060 | return; |
1059 | 1061 | } |
1060 | 1062 | throw e; |
|
0 commit comments