From 564279be83e84f9debbfa217512202b9df3df18b Mon Sep 17 00:00:00 2001 From: Han Fei Date: Wed, 30 Nov 2022 12:00:09 +0100 Subject: [PATCH] fix integration tests --- src/Storages/MergeTree/MergeTreeDataWriter.cpp | 1 + .../02481_async_insert_dedup.python | 18 ++++++++++++++---- .../02481_async_insert_dedup.reference | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Storages/MergeTree/MergeTreeDataWriter.cpp b/src/Storages/MergeTree/MergeTreeDataWriter.cpp index 69128f23c85..c50c01ea356 100644 --- a/src/Storages/MergeTree/MergeTreeDataWriter.cpp +++ b/src/Storages/MergeTree/MergeTreeDataWriter.cpp @@ -193,6 +193,7 @@ BlocksWithPartition MergeTreeDataWriter::splitBlockIntoParts( if (!metadata_snapshot->hasPartitionKey()) /// Table is not partitioned. { result.emplace_back(Block(block), Row{}); + result[0].offsets = chunk_offsets; return result; } diff --git a/tests/queries/0_stateless/02481_async_insert_dedup.python b/tests/queries/0_stateless/02481_async_insert_dedup.python index 6369fac3747..fac031434b4 100644 --- a/tests/queries/0_stateless/02481_async_insert_dedup.python +++ b/tests/queries/0_stateless/02481_async_insert_dedup.python @@ -14,6 +14,20 @@ from pure_http_client import ClickHouseClient client = ClickHouseClient() +# test table without partition +client.query("DROP TABLE IF EXISTS t_async_insert_dedup_no_part NO DELAY") +client.query(''' +CREATE TABLE t_async_insert_dedup_no_part ( +KeyID UInt32 +) Engine = ReplicatedMergeTree('/clickhouse/tables/{shard}/{database}/t_async_insert_dedup', '{replica}') +ORDER BY (KeyID) +''') + +client.query("insert into t_async_insert_dedup_no_part values (1), (2), (3), (4), (5)", settings = {"async_insert": 1, "wait_for_async_insert": 1, "insert_keeper_fault_injection_probability": 0}) +result = client.query("select count(*) from t_async_insert_dedup_no_part") +print(result, flush=True) +client.query("DROP TABLE IF EXISTS t_async_insert_dedup_no_part NO DELAY") + # generate data and push to queue def generate_data(q, total_number): old_data = [] @@ -82,10 +96,6 @@ for i in range(3): gen.join() - -#result = client.query("select count(*) from t_async_insert_dedup") -#print(result, flush=True) - retry = 0 while (True): diff --git a/tests/queries/0_stateless/02481_async_insert_dedup.reference b/tests/queries/0_stateless/02481_async_insert_dedup.reference index 5caff40c4a0..a91c59a7fc5 100644 --- a/tests/queries/0_stateless/02481_async_insert_dedup.reference +++ b/tests/queries/0_stateless/02481_async_insert_dedup.reference @@ -1 +1,3 @@ +5 + 10000