Fixed error; added test

This commit is contained in:
Alexey Milovidov 2019-07-15 19:32:52 +03:00
parent 4d14f8c230
commit b3c0292613
3 changed files with 11 additions and 1 deletions

View File

@ -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()

View 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+>'