mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fixed error; added test
This commit is contained in:
parent
4d14f8c230
commit
b3c0292613
@ -29,6 +29,7 @@ namespace ErrorCodes
|
||||
void ThreadStatus::attachQueryContext(Context & query_context_)
|
||||
{
|
||||
query_context = &query_context_;
|
||||
query_id = query_context->getCurrentQueryId();
|
||||
if (!global_context)
|
||||
global_context = &query_context->getGlobalContext();
|
||||
|
||||
@ -270,7 +271,7 @@ void CurrentThread::attachQueryContext(Context & query_context)
|
||||
{
|
||||
if (unlikely(!current_thread))
|
||||
return;
|
||||
return current_thread->attachQueryContext(query_context);
|
||||
current_thread->attachQueryContext(query_context);
|
||||
}
|
||||
|
||||
void CurrentThread::finalizePerformanceCounters()
|
||||
|
9
dbms/tests/queries/0_stateless/00971_query_id_in_logs.sh
Executable file
9
dbms/tests/queries/0_stateless/00971_query_id_in_logs.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. $CURDIR/../shell_config.sh
|
||||
|
||||
set -e
|
||||
|
||||
# No log lines without query id
|
||||
$CLICKHOUSE_CLIENT --send_logs_level=trace --query_id=hello --query="SELECT count() FROM numbers(10)" 2>&1 | grep -vF ' {hello} ' | grep -P '<\w+>'
|
Loading…
Reference in New Issue
Block a user