Merge pull request #69175 from azat/revert-client-log_comment-file

Revert "Merge pull request #57191 from azat/client-log_comment-file"
This commit is contained in:
Raúl Marín 2024-09-03 15:47:54 +00:00 committed by GitHub
commit dd6e818c68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 0 additions and 38 deletions

View File

@ -2699,14 +2699,6 @@ bool ClientBase::processMultiQueryFromFile(const String & file_name)
ReadBufferFromFile in(file_name);
readStringUntilEOF(queries_from_file, in);
if (!getClientConfiguration().has("log_comment"))
{
Settings settings = client_context->getSettingsCopy();
/// 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));
client_context->setSettings(settings);
}
return executeMultiQuery(queries_from_file);
}

View File

@ -1,6 +0,0 @@
42
4242
424242
select 42 clickhouse.default-1.sql
select 4242 clickhouse.default-2.sql
select 424242\n foo

View File

@ -1,24 +0,0 @@
#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# reset --log_comment, because the test has to set its own
CLICKHOUSE_LOG_COMMENT=
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
file1="$CUR_DIR/clickhouse.${CLICKHOUSE_DATABASE}-1.sql"
echo -n 'select 42' >> "$file1"
file2="$CUR_DIR/clickhouse.${CLICKHOUSE_DATABASE}-2.sql"
echo -n 'select 4242' >> "$file2"
$CLICKHOUSE_CLIENT --queries-file "$file1" "$file2" <<<'select 42'
$CLICKHOUSE_CLIENT --log_comment foo --queries-file /dev/stdin <<<'select 424242'
$CLICKHOUSE_CLIENT -m -q "
system flush logs;
select query, log_comment from system.query_log where current_database = '$CLICKHOUSE_DATABASE' and event_date >= yesterday() and query = 'select 42' and type != 'QueryStart';
select query, log_comment from system.query_log where current_database = '$CLICKHOUSE_DATABASE' and event_date >= yesterday() and query = 'select 4242' and type != 'QueryStart';
select query, log_comment from system.query_log where current_database = '$CLICKHOUSE_DATABASE' and event_date >= yesterday() and query = 'select 424242\n' and type != 'QueryStart';
" | sed "s#$CUR_DIR/##"
rm "$file1" "$file2"