Update ClientBase.cpp

This commit is contained in:
Yarik Briukhovetskyi 2023-11-28 15:38:20 +01:00 committed by GitHub
parent 0b15efeb51
commit c4d157fe84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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