Try fix tests.

This commit is contained in:
Nikolai Kochetov 2020-10-22 14:08:12 +03:00
parent 7fa045cff8
commit c91b453630
2 changed files with 5 additions and 2 deletions

View File

@ -1439,8 +1439,6 @@ void InterpreterSelectQuery::executeFetchColumns(
if (!max_block_size) if (!max_block_size)
throw Exception("Setting 'max_block_size' cannot be zero", ErrorCodes::PARAMETER_OUT_OF_BOUND); throw Exception("Setting 'max_block_size' cannot be zero", ErrorCodes::PARAMETER_OUT_OF_BOUND);
query_plan.setMaxThreads(max_threads_execute_query);
/// Initialize the initial data streams to which the query transforms are superimposed. Table or subquery or prepared input? /// Initialize the initial data streams to which the query transforms are superimposed. Table or subquery or prepared input?
if (query_plan.isInitialized()) if (query_plan.isInitialized())
{ {
@ -1542,6 +1540,10 @@ void InterpreterSelectQuery::executeFetchColumns(
else else
throw Exception("Logical error in InterpreterSelectQuery: nowhere to read", ErrorCodes::LOGICAL_ERROR); throw Exception("Logical error in InterpreterSelectQuery: nowhere to read", ErrorCodes::LOGICAL_ERROR);
/// Specify the number of threads only if it wasn't specified in storage.
if (!query_plan.getMaxThreads())
query_plan.setMaxThreads(max_threads_execute_query);
/// Aliases in table declaration. /// Aliases in table declaration.
if (processing_stage == QueryProcessingStage::FetchColumns && alias_actions) if (processing_stage == QueryProcessingStage::FetchColumns && alias_actions)
{ {

View File

@ -69,6 +69,7 @@ public:
/// Set upper limit for the recommend number of threads. Will be applied to the newly-created pipelines. /// Set upper limit for the recommend number of threads. Will be applied to the newly-created pipelines.
/// TODO: make it in a better way. /// TODO: make it in a better way.
void setMaxThreads(size_t max_threads_) { max_threads = max_threads_; } void setMaxThreads(size_t max_threads_) { max_threads = max_threads_; }
size_t getMaxThreads() const { return max_threads; }
void addInterpreterContext(std::shared_ptr<Context> context); void addInterpreterContext(std::shared_ptr<Context> context);