Skip to content

Commit 12191bd

Browse files
committed
Merge branch 'main' into v2_json_support
2 parents 3852897 + ff13581 commit 12191bd

File tree

13 files changed

+56
-24
lines changed

13 files changed

+56
-24
lines changed

.github/workflows/nightly.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
env:
1414
CHC_BRANCH: "main"
1515
CHC_VERSION: "0.7.1"
16+
CH_VERSION: "24.8"
1617

1718
jobs:
1819
nightly:
@@ -66,7 +67,7 @@ jobs:
6667
uses: samuelmeuli/action-maven-publish@v1
6768
with:
6869
maven_profiles: release
69-
maven_args: -q --batch-mode
70+
maven_args: -q --batch-mode -DclickhouseVersion=${{ env.CH_VERSION }}
7071
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
7172
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
7273
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}
@@ -76,7 +77,7 @@ jobs:
7677
with:
7778
directory: clickhouse-r2dbc
7879
maven_profiles: release
79-
maven_args: -q --batch-mode -Dr2dbc-spi.version=0.9.1.RELEASE
80+
maven_args: -q --batch-mode -Dr2dbc-spi.version=0.9.1.RELEASE -DclickhouseVersion=${{ env.CH_VERSION }}
8081
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
8182
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
8283
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
required: true
99
default: "0.7.1-SNAPSHOT"
1010

11+
env:
12+
CH_VERSION: "24.8"
13+
1114
jobs:
1215
release:
1316
name: "Build and Publish Artifact"
@@ -54,7 +57,7 @@ jobs:
5457
uses: samuelmeuli/action-maven-publish@v1
5558
with:
5659
maven_profiles: release
57-
maven_args: -q --batch-mode
60+
maven_args: -q --batch-mode -DclickhouseVersion=${{ env.CH_VERSION }}
5861
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
5962
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
6063
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}
@@ -64,7 +67,7 @@ jobs:
6467
with:
6568
directory: clickhouse-r2dbc
6669
maven_profiles: release
67-
maven_args: -q --batch-mode -Dr2dbc-spi.version=0.9.1.RELEASE
70+
maven_args: -q --batch-mode -Dr2dbc-spi.version=0.9.1.RELEASE -DclickhouseVersion=${{ env.CH_VERSION }}
6871
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
6972
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
7073
nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 0.7.1-patch1
2+
3+
### Bug Fixes
4+
- [JDBC] Fixed `java.lang.NoClassDefFoundError: com/clickhouse/client/internal/apache/hc/core5/http2/HttpVersionPolicy` (https://github.com/ClickHouse/clickhouse-java/issues/1912)
5+
- [client-v2] Fixed multiple issues with error message handling. (https://github.com/ClickHouse/clickhouse-java/issues/1906)
6+
- [client-v2] Fixed primitive types conversion. Now client correctly handles numbers to boolean and vice-versa. (https://github.com/ClickHouse/clickhouse-java/issues/1908)
7+
18
## 0.7.1
29

310
### New Features

examples/client-v2/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6565
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6666

67-
<clickhouse-java.version>0.7.1-SNAPSHOT</clickhouse-java.version>
67+
<clickhouse-java.version>0.7.1-patch1-SNAPSHOT</clickhouse-java.version>
6868
<apache-httpclient.version>5.3.1</apache-httpclient.version>
6969

7070
<compiler-plugin.version>3.8.1</compiler-plugin.version>

examples/client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6767
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6868

69-
<clickhouse-java.version>0.7.1-SNAPSHOT</clickhouse-java.version>
69+
<clickhouse-java.version>0.7.1-patch1-SNAPSHOT</clickhouse-java.version>
7070
<!-- Nightly snapshot version from https://s01.oss.sonatype.org/content/repositories/snapshots/ or latest from local -->
7171
<!-- <clickhouse-java.version>0.7.1</clickhouse-java.version>-->
7272

examples/demo-kotlin-service/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
3434

3535
// https://mvnrepository.com/artifact/com.clickhouse/client-v2
36-
implementation("com.clickhouse:client-v2:0.7.1-SNAPSHOT")
36+
implementation("com.clickhouse:client-v2:0.7.1-patch1-SNAPSHOT")
3737
// implementation("com.clickhouse:client-v2:0.7.1") // release version
3838

3939
testImplementation("io.ktor:ktor-server-test-host-jvm")

examples/demo-service/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929

3030
// -- clickhouse dependencies
3131
// Main dependency
32-
implementation("com.clickhouse:client-v2:0.7.1-SNAPSHOT") // local or nightly build
32+
implementation("com.clickhouse:client-v2:0.7.1-patch1-SNAPSHOT") // local or nightly build
3333
// implementation("com.clickhouse:client-v2:0.7.1") // release version
3434

3535
// -- clickhouse-http-client dependencies if old implementation is needed

examples/jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6767
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6868

69-
<clickhouse-java.version>0.7.1-SNAPSHOT</clickhouse-java.version>
69+
<clickhouse-java.version>0.7.1-patch1-SNAPSHOT</clickhouse-java.version>
7070
<hikaricp.version>4.0.3</hikaricp.version>
7171
<apache-httpclient.version>5.2.1</apache-httpclient.version>
7272

jdbc-v2/src/main/java/com/clickhouse/jdbc/PreparedStatementImpl.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
import java.io.Reader;
88
import java.math.BigDecimal;
99
import java.net.URL;
10-
import java.nio.charset.StandardCharsets;
1110
import java.sql.*;
12-
import java.time.LocalDateTime;
1311
import java.time.ZoneId;
1412
import java.time.format.DateTimeFormatter;
1513
import java.time.format.DateTimeFormatterBuilder;
1614
import java.time.temporal.ChronoField;
17-
import java.time.temporal.TemporalField;
1815
import java.util.Calendar;
1916
import java.util.GregorianCalendar;
2017

@@ -78,13 +75,13 @@ public void setNull(int parameterIndex, int sqlType) throws SQLException {
7875
@Override
7976
public void setBoolean(int parameterIndex, boolean x) throws SQLException {
8077
checkClosed();
81-
parameters[parameterIndex - 1] = x;
78+
parameters[parameterIndex - 1] = Boolean.toString(x);
8279
}
8380

8481
@Override
8582
public void setByte(int parameterIndex, byte x) throws SQLException {
8683
checkClosed();
87-
parameters[parameterIndex - 1] = x;
84+
parameters[parameterIndex - 1] = Byte.toString(x);
8885
}
8986

9087
@Override
@@ -132,7 +129,7 @@ public void setString(int parameterIndex, String x) throws SQLException {
132129
@Override
133130
public void setBytes(int parameterIndex, byte[] x) throws SQLException {
134131
checkClosed();
135-
parameters[parameterIndex - 1] = new String(x, StandardCharsets.UTF_8);
132+
throw new SQLFeatureNotSupportedException("Bytes is not yet supported.");
136133
}
137134

138135
@Override
@@ -265,7 +262,6 @@ public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLExceptio
265262
ZoneId tz = cal.getTimeZone().toZoneId();
266263
Calendar c = (Calendar) cal.clone();
267264
c.setTime(x);
268-
System.out.println(String.format("'%s'", TIME_FORMATTER.format(c.toInstant().atZone(tz).toLocalTime())));
269265
parameters[parameterIndex - 1] = String.format("'%s'", TIME_FORMATTER.format(c.toInstant().atZone(tz).toLocalTime()));
270266
}
271267

jdbc-v2/src/main/java/com/clickhouse/jdbc/ResultSetImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public boolean next() throws SQLException {
5757
public void close() throws SQLException {
5858
closed = true;
5959
if (reader != null) {
60+
try {
61+
reader.close();
62+
} catch (Exception e) {
63+
throw new SQLException(e);
64+
}
65+
6066
reader = null;
6167
}
6268

0 commit comments

Comments
 (0)