Fix progress for insert select.

This commit is contained in:
Nikolai Kochetov 2021-09-22 16:29:58 +03:00
parent 81bf13a247
commit eed4e8c754
2 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#pragma once
#include <functional>
#include <memory>
namespace DB
{

View File

@ -310,7 +310,20 @@ void TCPHandler::runImpl()
CompletedPipelineExecutor executor(state.io.pipeline);
/// Should not check for cancel in case of input.
if (!state.need_receive_data_for_input)
executor.setCancelCallback([this]() { return isQueryCancelled(); }, interactive_delay / 1000);
{
auto callback = [this]()
{
if (isQueryCancelled())
return true;
sendProgress();
sendLogs();
return false;
};
executor.setCancelCallback(callback, interactive_delay / 1000);
}
executor.execute();
}