More correct

This commit is contained in:
Alexey Milovidov 2021-07-19 20:23:16 +03:00
parent c85b7ad556
commit 2e4dcc2422
2 changed files with 7 additions and 4 deletions

View File

@ -351,17 +351,20 @@ Chunk DDLQueryStatusSource::generate()
}
}
void DDLQueryStatusSource::work()
IProcessor::Status DDLQueryStatusSource::prepare()
{
SourceWithProgress::work();
if (finished)
{
bool throw_if_error_on_host = context->getSettingsRef().distributed_ddl_output_mode != DistributedDDLOutputMode::NEVER_THROW;
if (first_exception && throw_if_error_on_host)
output.pushException(std::make_exception_ptr(*first_exception));
output.finish();
return Status::Finished;
}
else
return SourceWithProgress::prepare();
}
Strings DDLQueryStatusSource::getChildrenAllowNoNode(const std::shared_ptr<zkutil::ZooKeeper> & zookeeper, const String & node_path)

View File

@ -38,7 +38,7 @@ public:
String getName() const override { return "DDLQueryStatus"; }
Chunk generate() override;
void work() override;
Status prepare() override;
private:
static Strings getChildrenAllowNoNode(const std::shared_ptr<zkutil::ZooKeeper> & zookeeper, const String & node_path);