From 1be7c0970273ece874f3df5186c13675f78d0ad1 Mon Sep 17 00:00:00 2001 From: Alex Zatelepin Date: Tue, 27 Mar 2018 22:25:50 +0000 Subject: [PATCH] add readPrefix()/readSuffix() calls for completeness #2084 [#CLICKHOUSE-3540] --- dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp b/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp index 743c24cc6ca..dc6e2ef2ea7 100644 --- a/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp +++ b/dbms/src/DataStreams/PushingToViewsBlockOutputStream.cpp @@ -74,8 +74,13 @@ void PushingToViewsBlockOutputStream::write(const Block & block) BlockInputStreamPtr from = std::make_shared(block); InterpreterSelectQuery select(view.query, *views_context, {}, QueryProcessingStage::Complete, 0, from); BlockInputStreamPtr data = std::make_shared(select.execute().in); + + data->readPrefix(); + while (Block result_block = data->read()) view.out->write(result_block); + + data->readSuffix(); } catch (Exception & ex) {