Skip to content

Commit b3a86be

Browse files
authored
Merge pull request #1311 from zhicwu/main
Fix build failure
2 parents b175afa + 4db60e8 commit b3a86be

File tree

2 files changed

+38
-8
lines changed

2 files changed

+38
-8
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
matrix:
177177
# most recent LTS releases as well as latest stable builds
178178
# https://github.com/ClickHouse/ClickHouse/pulls?q=is%3Aopen+is%3Apr+label%3Arelease
179-
clickhouse: ["22.3", "22.8", "latest"]
179+
clickhouse: ["22.3", "22.8", "23.3", "latest"]
180180
fail-fast: false
181181
timeout-minutes: 15
182182
name: Java client + CH ${{ matrix.clickhouse }}
@@ -231,7 +231,7 @@ jobs:
231231
needs: compile
232232
strategy:
233233
matrix:
234-
clickhouse: ["22.3", "22.8", "latest"]
234+
clickhouse: ["22.3", "22.8", "23.3", "latest"]
235235
# here http, http_client and apache_http_client represent different value of http_connection_provider
236236
protocol: ["http", "http_client", "apache_http_client", "grpc"]
237237
fail-fast: false
@@ -290,7 +290,7 @@ jobs:
290290
needs: compile
291291
strategy:
292292
matrix:
293-
clickhouse: ["22.3", "22.8", "latest"]
293+
clickhouse: ["22.3", "22.8", "23.3", "latest"]
294294
# grpc is not fully supported, and http_client and apache_http_client do not work in CI environment(due to limited threads?)
295295
protocol: ["http"]
296296
r2dbc: ["1.0.0.RELEASE", "0.9.1.RELEASE"]

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

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import java.util.Properties;
1010
import java.util.UUID;
1111

12+
import com.clickhouse.client.ClickHouseProtocol;
13+
import com.clickhouse.client.ClickHouseRequest;
1214
import com.clickhouse.client.config.ClickHouseClientOption;
1315
import com.clickhouse.data.ClickHouseCompression;
1416
import com.clickhouse.data.ClickHouseUtils;
@@ -28,7 +30,15 @@ public ClickHouseConnection newConnection(Properties properties) throws SQLExcep
2830
public void testCentralizedConfiguration() throws SQLException {
2931
Properties props = new Properties();
3032
props.setProperty("custom_settings", "max_result_rows=1");
31-
try (ClickHouseConnection conn = newConnection(props)) {
33+
try (ClickHouseConnection conn = newConnection(props); Statement stmt = conn.createStatement()) {
34+
// gRPC stopped working since 23.3 with below error:
35+
// SQL Code: 649, DB::Exception: Transaction Control Language queries are
36+
// allowed only inside session: while starting a transaction with
37+
// 'implicit_transaction'
38+
if (stmt.unwrap(ClickHouseRequest.class).getServer().getProtocol() == ClickHouseProtocol.GRPC) {
39+
throw new SkipException("Skip the test as transaction is supported since 22.7");
40+
}
41+
3242
Assert.assertEquals(conn.getConfig().getResponseCompressAlgorithm(), ClickHouseCompression.LZ4);
3343
Assert.assertTrue(conn.getJdbcConfig().isAutoCommit());
3444
Assert.assertFalse(conn.getJdbcConfig().isTransactionSupported());
@@ -121,7 +131,12 @@ public void testAutoCommitMode() throws SQLException {
121131

122132
for (int i = 0; i < 10; i++) {
123133
try (ClickHouseConnection conn = newConnection(props); Statement stmt = conn.createStatement()) {
124-
if (!conn.getServerVersion().check("[22.7,)")) {
134+
if (!conn.getServerVersion().check("[22.7,)")
135+
// gRPC stopped working since 23.3 with below error:
136+
// SQL Code: 649, DB::Exception: Transaction Control Language queries are
137+
// allowed only inside session: while starting a transaction with
138+
// 'implicit_transaction'
139+
|| stmt.unwrap(ClickHouseRequest.class).getServer().getProtocol() == ClickHouseProtocol.GRPC) {
125140
throw new SkipException("Skip the test as transaction is supported since 22.7");
126141
}
127142
stmt.execute("select 1, throwIf(" + i + " % 3 = 0)");
@@ -292,7 +307,12 @@ public void testAutoCommit() throws SQLException {
292307
props.setProperty("transactionSupport", "true");
293308
String tableName = "test_jdbc_tx_auto_commit";
294309
try (ClickHouseConnection c = newConnection(props); Statement s = c.createStatement()) {
295-
if (!c.getServerVersion().check("[22.7,)")) {
310+
if (!c.getServerVersion().check("[22.7,)")
311+
// gRPC stopped working since 23.3 with below error:
312+
// SQL Code: 649, DB::Exception: Transaction Control Language queries are
313+
// allowed only inside session: while starting a transaction with
314+
// 'implicit_transaction'
315+
|| s.unwrap(ClickHouseRequest.class).getServer().getProtocol() == ClickHouseProtocol.GRPC) {
296316
throw new SkipException("Skip the test as transaction is supported since 22.7");
297317
}
298318
s.execute("drop table if exists " + tableName + "; "
@@ -385,7 +405,12 @@ public void testManualTxApi() throws SQLException {
385405
txProps.setProperty("transactionSupport", "true");
386406
String tableName = "test_jdbc_manual_tx_api";
387407
try (ClickHouseConnection c = newConnection(txProps); Statement s = c.createStatement()) {
388-
if (!c.getServerVersion().check("[22.7,)")) {
408+
if (!c.getServerVersion().check("[22.7,)")
409+
// gRPC stopped working since 23.3 with below error:
410+
// SQL Code: 649, DB::Exception: Transaction Control Language queries are
411+
// allowed only inside session: while starting a transaction with
412+
// 'implicit_transaction'
413+
|| s.unwrap(ClickHouseRequest.class).getServer().getProtocol() == ClickHouseProtocol.GRPC) {
389414
throw new SkipException("Skip the test as transaction is supported since 22.7");
390415
}
391416
s.execute("drop table if exists " + tableName + "; "
@@ -496,7 +521,12 @@ public void testManualTxTcl() throws SQLException {
496521
txProps.setProperty("transactionSupport", "true");
497522
String tableName = "test_jdbc_manual_tx_tcl";
498523
try (ClickHouseConnection c = newConnection(txProps); Statement s = c.createStatement()) {
499-
if (!c.getServerVersion().check("[22.7,)")) {
524+
if (!c.getServerVersion().check("[22.7,)")
525+
// gRPC stopped working since 23.3 with below error:
526+
// SQL Code: 649, DB::Exception: Transaction Control Language queries are
527+
// allowed only inside session: while starting a transaction with
528+
// 'implicit_transaction'
529+
|| s.unwrap(ClickHouseRequest.class).getServer().getProtocol() == ClickHouseProtocol.GRPC) {
500530
throw new SkipException("Skip the test as transaction is supported since 22.7");
501531
}
502532
s.execute("drop table if exists " + tableName + "; "

0 commit comments

Comments
 (0)