diff --git a/src/DataStreams/RemoteQueryExecutor.cpp b/src/DataStreams/RemoteQueryExecutor.cpp index f0e2abad1d3..1b1bf2af8ef 100644 --- a/src/DataStreams/RemoteQueryExecutor.cpp +++ b/src/DataStreams/RemoteQueryExecutor.cpp @@ -271,6 +271,12 @@ void RemoteQueryExecutor::finish() finished = true; break; + case Protocol::Server::Log: + /// Pass logs from remote server to client + if (auto log_queue = CurrentThread::getInternalTextLogsQueue()) + log_queue->pushBlock(std::move(packet.block)); + break; + case Protocol::Server::Exception: got_exception_from_replica = true; packet.exception->rethrow(); diff --git a/tests/queries/0_stateless/01451_dist_logs.reference b/tests/queries/0_stateless/01451_dist_logs.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/01451_dist_logs.sh b/tests/queries/0_stateless/01451_dist_logs.sh new file mode 100755 index 00000000000..77b2a91c3aa --- /dev/null +++ b/tests/queries/0_stateless/01451_dist_logs.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=trace +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. "$CURDIR"/../shell_config.sh + +# triggered not for the first query +yes "select * from remote('127.{2,3}', system.numbers) where number = 10 limit 1;" 2>/dev/null | { + head -n20 | ${CLICKHOUSE_CLIENT} -n 2>&1 >/dev/null | grep 'DB::Exception: ' +} +# grep above will fail during diff with .reference +exit 0