From 8df3e48a7b997f423840af6ec1642f2699272ccd Mon Sep 17 00:00:00 2001 From: Vitaliy Zakaznikov Date: Mon, 17 Jun 2019 12:39:01 -0400 Subject: [PATCH] * Fixing bug in writeIntoLiveView method where mergeable blocks would always be reobtained after 64 inserts --- dbms/src/Storages/StorageLiveView.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageLiveView.h b/dbms/src/Storages/StorageLiveView.h index 69410ec4e8b..84a7ea80bca 100644 --- a/dbms/src/Storages/StorageLiveView.h +++ b/dbms/src/Storages/StorageLiveView.h @@ -141,6 +141,7 @@ public: std::shared_ptr getBlocksPtr() { return blocks_ptr; } BlocksPtrs getMergeableBlocks() { return mergeable_blocks; } + void setMergeableBlocks(BlocksPtrs blocks) { mergeable_blocks = blocks; } std::shared_ptr getActivePtr() { return active_ptr; } /// Read new data blocks that store query result @@ -193,12 +194,13 @@ public: { mergeable_blocks = std::make_shared>(); BlocksPtr base_mergeable_blocks = std::make_shared(); - InterpreterSelectQuery interpreter(live_view.getInnerQuery(), context, SelectQueryOptions(QueryProcessingStage::WithMergeableState), Names{}); + InterpreterSelectQuery interpreter(live_view.getInnerQuery(), context, SelectQueryOptions(QueryProcessingStage::WithMergeableState), Names()); auto view_mergeable_stream = std::make_shared( interpreter.execute().in); while (Block this_block = view_mergeable_stream->read()) base_mergeable_blocks->push_back(this_block); mergeable_blocks->push_back(base_mergeable_blocks); + live_view.setMergeableBlocks(mergeable_blocks); } /// Need make new mergeable block structure match the other mergeable blocks