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); }