提交 4c895709 编写于 作者: A Alexey Milovidov

Don't limit the size of internal queries (this is for cache dictionaries with...

Don't limit the size of internal queries (this is for cache dictionaries with ClickHouse source) [#CLICKHOUSE-2].
上级 dd1f54bc
......@@ -97,7 +97,7 @@ std::string ClickHouseDictionarySource::toString() const
}
BlockInputStreamPtr ClickHouseDictionarySource::createStreamForSelectiveLoad(const std::string query)
BlockInputStreamPtr ClickHouseDictionarySource::createStreamForSelectiveLoad(const std::string & query)
{
if (is_local)
return executeQuery(query, context, true).in;
......
......@@ -41,7 +41,7 @@ public:
std::string toString() const override;
private:
BlockInputStreamPtr createStreamForSelectiveLoad(const std::string query);
BlockInputStreamPtr createStreamForSelectiveLoad(const std::string & query);
const DictionaryStructure dict_struct;
const std::string host;
......
......@@ -135,10 +135,15 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
ParserQuery parser(end);
ASTPtr ast;
size_t query_size;
size_t max_query_size = settings.max_query_size;
/// Don't limit the size of internal queries.
size_t max_query_size = 0;
if (!internal)
max_query_size = settings.max_query_size;
try
{
/// TODO Parser should fail early when max_query_size limit is reached.
ast = parseQuery(parser, begin, end, "");
/// Copy query into string. It will be written to log and presented in processlist. If an INSERT query, string will not include data to insertion.
......@@ -150,9 +155,9 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
}
catch (...)
{
/// Anyway log query.
if (!internal)
{
/// Anyway log the query.
String query = String(begin, begin + std::min(end - begin, static_cast<ptrdiff_t>(max_query_size)));
logQuery(query.substr(0, settings.log_queries_cut_to_length), context);
onExceptionBeforeStart(query, context, current_time);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册