| 17 | } |
| 18 | |
| 19 | ContextMutablePtr createContextForSubQuery(ContextPtr context, String sub_query_tag) |
| 20 | { |
| 21 | auto query_context = Context::createCopy(context); |
| 22 | query_context->makeSessionContext(); |
| 23 | query_context->makeQueryContext(); |
| 24 | |
| 25 | auto parent_initial_query_id = context->getInitialQueryId(); |
| 26 | auto uuid = UUIDHelpers::UUIDToString(UUIDHelpers::generateV4()); |
| 27 | String initial_query_id; |
| 28 | if (sub_query_tag.empty()) |
| 29 | initial_query_id = fmt::format("{}_{}", context->getCurrentQueryId(), uuid); |
| 30 | else |
| 31 | initial_query_id = fmt::format("{}_{}_{}", context->getCurrentQueryId(), sub_query_tag, uuid); |
| 32 | |
| 33 | query_context->getClientInfo().parent_initial_query_id = parent_initial_query_id; |
| 34 | query_context->getClientInfo().initial_query_id = initial_query_id; |
| 35 | query_context->setCurrentQueryId(initial_query_id); |
| 36 | |
| 37 | return query_context; |
| 38 | } |
| 39 | |
| 40 | void modifyQueryContext(ContextMutablePtr query_context, bool internal) |
| 41 | { |
no test coverage detected