| 427 | } |
| 428 | |
| 429 | Block InterpreterKillQueryQuery::getSelectResult(const String & columns, const String & table) |
| 430 | { |
| 431 | String select_query = "SELECT " + columns + " FROM " + table; |
| 432 | auto & where_expression = query_ptr->as<ASTKillQueryQuery>()->where_expression; |
| 433 | if (where_expression) |
| 434 | select_query += " WHERE " + where_expression->formatWithSecretsOneLine(); |
| 435 | |
| 436 | auto query_context = Context::createCopy(getContext()); |
| 437 | query_context->makeQueryContext(); |
| 438 | query_context->setCurrentQueryId(""); |
| 439 | |
| 440 | auto io = executeQuery(select_query, std::move(query_context), QueryFlags{ .internal = true }).second; |
| 441 | |
| 442 | Block res; |
| 443 | Block tmp_block; |
| 444 | io.executeWithCallbacks([&]() |
| 445 | { |
| 446 | PullingPipelineExecutor executor(io.pipeline); |
| 447 | while (res.empty() && executor.pull(res)); |
| 448 | |
| 449 | while (executor.pull(tmp_block)); |
| 450 | }); |
| 451 | |
| 452 | if (!tmp_block.empty()) |
| 453 | throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected one block from input stream"); |
| 454 | |
| 455 | /// Materialize const columns, because callers use typeid_cast to concrete column types. |
| 456 | materializeBlockInplace(res); |
| 457 | |
| 458 | return res; |
| 459 | } |
| 460 | |
| 461 | |
| 462 | AccessRightsElements InterpreterKillQueryQuery::getRequiredAccessForDDLOnCluster() const |
nothing calls this directly
no test coverage detected