With Processors max_distributed_connections does not used anymore, since
it always uses not more then max_threads (see
TCPHandler::processOrdinaryQueryWithProcessors()/
QueryPipeline::execute()/PipelineExecutor::execute())
So just use QueryPipeline::getNumThreads(), that takes
max_distributed_connections into account.
Before this patch if the query failes (due to "Too many simultaneous
queries" for example) it will not read external tables info, and the
next request will interpret them as the query beginning at got:
DB::Exception: Unknown packet 11861 from client
v2: reordering in the executeQuery() is not enough, since the query
can fail in other places, before, i.e. quotas
v3: I cannot make non-intergration test (since there is no ability to
receive "Unknown packet" via client, only from the server log),
hence added one
* CLICKHOUSE-3771: compatible version transfer
* Fix
* Fixed compatibility
* fix
* Auto version update to [1.1.54401] [54398]
* fix auto revision up
* fix
* comments
* clean
* fix
* Send/recieve patch if we can
* fix
* Auto version update to [18.2.0] [54397]
* Client version in query_log
* Update TCPHandler.cpp
* Update Connection.cpp
* Update Defines.h