mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
CLICKHOUSE-3878: Correct max_block_size handling
This commit is contained in:
parent
fe10ccb1f7
commit
b31dd7bf1f
@ -30,7 +30,7 @@ Poco::Net::HTTPRequestHandler * HandlerFactory::createRequestHandler(const Poco:
|
||||
std::string DSN = params.get("DSN", "");
|
||||
std::string database = params.get("database", "");
|
||||
|
||||
std::string max_block_size = params.get("max_block_size", "");
|
||||
std::string max_block_size_str = params.get("max_block_size", "");
|
||||
std::string format = params.get("format", "RowBinary");
|
||||
|
||||
std::string connection_string = buildConnectionString(DSN, database);
|
||||
@ -55,10 +55,20 @@ Poco::Net::HTTPRequestHandler * HandlerFactory::createRequestHandler(const Poco:
|
||||
pool = pool_map[connection_string];
|
||||
}
|
||||
|
||||
size_t max_block_size = DEFAULT_BLOCK_SIZE;
|
||||
|
||||
if (!max_block_size_str.empty())
|
||||
try
|
||||
{
|
||||
max_block_size = std::stoul(max_block_size_str);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(log);
|
||||
}
|
||||
|
||||
if (request.getMethod() == Poco::Net::HTTPRequest::HTTP_POST)
|
||||
return new ODBCHandler(
|
||||
pool, format, max_block_size == "" ? DEFAULT_BLOCK_SIZE : parse<size_t>(max_block_size), keep_alive_timeout, context);
|
||||
return new ODBCHandler(pool, format, max_block_size, keep_alive_timeout, context);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user