Skip to content

Commit 92dd060

Browse files
committed
feat!: drop the wa-37420 feature
1 parent d678b15 commit 92dd060

File tree

7 files changed

+3
-95
lines changed

7 files changed

+3
-95
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- run: cargo test
4242
- run: cargo test --no-default-features
4343
- run: cargo test --features uuid,time
44+
- run: cargo test --all-features
4445

4546
services:
4647
clickhouse:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- derive: support `serde::skip_deserializing` ([#83]).
1212

1313
### Changed
14+
- **BREAKING** drop the `wa-37420` feature.
1415
- derive: move to syn v2.
1516

1617
### Fixed

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ uuid = ["dep:uuid"]
4343
time = ["dep:time"]
4444
tls = ["dep:hyper-tls"]
4545

46-
# Temporary workaround for https://github.com/ClickHouse/ClickHouse/issues/37420
47-
wa-37420 = []
48-
4946
[dependencies]
5047
clickhouse-derive = { version = "0.1.1", path = "derive" }
5148

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ clickhouse = { version = "0.11.6", features = ["test-util"] }
4343

4444
</summary>
4545

46-
CH server older than v22.6 (2022-06-16) handles `RowBinary` [incorrectly](https://github.com/ClickHouse/ClickHouse/issues/37420) in some rare cases. Enable `wa-37420` feature to solve this problem. Don't use it for newer versions.
46+
CH server older than v22.6 (2022-06-16) handles `RowBinary` [incorrectly](https://github.com/ClickHouse/ClickHouse/issues/37420) in some rare cases. Use 0.11 and enable `wa-37420` feature to solve this problem. Don't use it for newer versions.
4747

4848
</details>
4949
<details>

src/insert.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ const MIN_CHUNK_SIZE: usize = BUFFER_SIZE - 1024; // slightly less to avoid extr
2525
#[must_use]
2626
pub struct Insert<T> {
2727
buffer: BytesMut,
28-
#[cfg(feature = "wa-37420")]
29-
chunk_count: usize,
3028
sender: Option<body::Sender>,
3129
#[cfg(feature = "lz4")]
3230
compression: Compression,
@@ -102,8 +100,6 @@ impl<T> Insert<T> {
102100

103101
Ok(Self {
104102
buffer: BytesMut::with_capacity(BUFFER_SIZE),
105-
#[cfg(feature = "wa-37420")]
106-
chunk_count: 0,
107103
sender: Some(sender),
108104
#[cfg(feature = "lz4")]
109105
compression: client.compression,
@@ -189,10 +185,6 @@ impl<T> Insert<T> {
189185
return Ok(());
190186
}
191187

192-
// A temporary workaround for https://github.com/ClickHouse/ClickHouse/issues/37420.
193-
#[cfg(feature = "wa-37420")]
194-
self.prepend_bom();
195-
196188
// Hyper uses non-trivial and inefficient schema of buffering chunks.
197189
// It's difficult to determine when allocations occur.
198190
// So, instead we control it manually here and rely on the system allocator.
@@ -250,18 +242,6 @@ impl<T> Insert<T> {
250242
Ok(mem::replace(&mut self.buffer, BytesMut::with_capacity(BUFFER_SIZE)).freeze())
251243
}
252244

253-
#[cfg(feature = "wa-37420")]
254-
fn prepend_bom(&mut self) {
255-
if self.chunk_count == 0 && self.buffer.starts_with(&[0xef, 0xbb, 0xbf]) {
256-
let mut new_chunk = BytesMut::with_capacity(self.buffer.len() + 3);
257-
new_chunk.extend_from_slice(&[0xef, 0xbb, 0xbf]);
258-
new_chunk.extend_from_slice(&self.buffer);
259-
self.buffer = new_chunk;
260-
}
261-
262-
self.chunk_count += 1;
263-
}
264-
265245
fn abort(&mut self) {
266246
if let Some(sender) = self.sender.take() {
267247
sender.abort();

tests/it/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ mod nested;
1414
mod query;
1515
mod time;
1616
mod uuid;
17-
mod wa_37420;
1817
mod watch;
1918

2019
const HOST: &str = "localhost:8123";

tests/it/wa_37420.rs

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)