MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / execute

Method execute

src/Interpreters/InterpreterShowProcesslistQuery.cpp:21–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21BlockIO InterpreterShowProcesslistQuery::execute()
22{
23 auto context = getContext();
24
25 String query;
26 if (context->getSettingsRef()[Setting::show_processlist_include_internal])
27 {
28 query = "SELECT * FROM system.processes ORDER BY elapsed DESC";
29 }
30 else
31 {
32 query = "SELECT * FROM system.processes WHERE is_internal = 0 ORDER BY elapsed DESC";
33 }
34
35 auto query_context = Context::createCopy(context);
36 query_context->makeQueryContext();
37 query_context->setCurrentQueryId("");
38
39 return executeQuery(query, query_context, QueryFlags{ .internal = true }).second;
40}
41
42void registerInterpreterShowProcesslistQuery(InterpreterFactory & factory);
43void registerInterpreterShowProcesslistQuery(InterpreterFactory & factory)

Callers

nothing calls this directly

Calls 4

setCurrentQueryIdMethod · 0.80
executeQueryFunction · 0.70
getContextFunction · 0.50
makeQueryContextMethod · 0.45

Tested by

no test coverage detected