From c4d157fe840275641871998ffff841c624a3e373 Mon Sep 17 00:00:00 2001 From: Yarik Briukhovetskyi <114298166+yariks5s@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:38:20 +0100 Subject: [PATCH] Update ClientBase.cpp --- src/Client/ClientBase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Client/ClientBase.cpp b/src/Client/ClientBase.cpp index d2e3dd2fd0c..c9fe038d3b1 100644 --- a/src/Client/ClientBase.cpp +++ b/src/Client/ClientBase.cpp @@ -2566,6 +2566,14 @@ bool ClientBase::processMultiQueryFromFile(const String & file_name) ReadBufferFromFile in(file_name); readStringUntilEOF(queries_from_file, in); + if (!global_context->getSettings().log_comment.changed) + { + Settings settings = global_context->getSettings(); + /// NOTE: cannot use even weakly_canonical() since it fails for /dev/stdin due to resolving of "pipe:[X]" + settings.log_comment = fs::absolute(fs::path(file_name)); + global_context->setSettings(settings); + } + return executeMultiQuery(queries_from_file); }