Correct merge

This commit is contained in:
kssenii 2021-09-16 16:14:17 +00:00
parent c88dc460d4
commit 55619dcc1b
4 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,6 @@
set (CLICKHOUSE_CLIENT_SOURCES set (CLICKHOUSE_CLIENT_SOURCES
Client.cpp Client.cpp
TestTags.cpp
) )
set (CLICKHOUSE_CLIENT_LINK set (CLICKHOUSE_CLIENT_LINK

View File

@ -34,7 +34,7 @@
#include <Core/QueryProcessingStage.h> #include <Core/QueryProcessingStage.h>
#include <Client/TestHint.h> #include <Client/TestHint.h>
#include <Columns/ColumnString.h> #include <Columns/ColumnString.h>
#include "Columns/ColumnsNumber.h" #include <Columns/ColumnsNumber.h>
#include <Poco/Util/Application.h> #include <Poco/Util/Application.h>
#include <IO/ReadBufferFromString.h> #include <IO/ReadBufferFromString.h>
@ -62,6 +62,7 @@
#include <AggregateFunctions/registerAggregateFunctions.h> #include <AggregateFunctions/registerAggregateFunctions.h>
#include <Formats/registerFormats.h> #include <Formats/registerFormats.h>
#include <Formats/FormatFactory.h> #include <Formats/FormatFactory.h>
#include "TestTags.h"
#ifndef __clang__ #ifndef __clang__
#pragma GCC optimize("-fno-var-tracking-assignments") #pragma GCC optimize("-fno-var-tracking-assignments")
@ -218,11 +219,16 @@ bool Client::executeMultiQuery(const String & all_queries_text)
bool echo_query = echo_queries; bool echo_query = echo_queries;
/// Test tags are started with "--" so they are interpreted as comments anyway.
/// But if the echo is enabled we have to remove the test tags from `all_queries_text`
/// because we don't want test tags to be echoed.
size_t test_tags_length = test_mode ? getTestTagsLength(all_queries_text) : 0;
/// Several queries separated by ';'. /// Several queries separated by ';'.
/// INSERT data is ended by the end of line, not ';'. /// INSERT data is ended by the end of line, not ';'.
/// An exception is VALUES format where we also support semicolon in /// An exception is VALUES format where we also support semicolon in
/// addition to end of line. /// addition to end of line.
const char * this_query_begin = all_queries_text.data(); const char * this_query_begin = all_queries_text.data() + test_tags_length;
const char * this_query_end; const char * this_query_end;
const char * all_queries_end = all_queries_text.data() + all_queries_text.size(); const char * all_queries_end = all_queries_text.data() + all_queries_text.size();

View File

@ -800,9 +800,9 @@ void ClientBase::sendDataFrom(ReadBuffer & buf, Block & sample, const ColumnsDes
break; break;
} }
} }
catch (Exception & e) catch (Exception &)
{ {
e.addMessage(fmt::format("(in query: {})", full_query)); // e.addMessage(fmt::format("(in query: {})", full_query));
throw; throw;
} }

View File

@ -80,7 +80,7 @@ void LocalConnection::sendQuery(
try try
{ {
state->io = executeQuery(state->query, query_context, false, state->stage, true); state->io = executeQuery(state->query, query_context, false, state->stage);
if (state->io.out) if (state->io.out)
{ {