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

Method executeQueryWithTracking

src/Server/PostgreSQLHandler.cpp:688–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686}
687
688UInt64 PostgreSQLHandler::executeQueryWithTracking(
689 String && sql_query,
690 ContextMutablePtr query_context,
691 PostgreSQLProtocol::Messaging::CommandComplete::Command command)
692{
693 // Track affected rows using progress callback (similar to MySQL handler)
694 std::atomic<UInt64> result_rows {0};
695 std::atomic<UInt64> written_rows {0};
696 query_context->setProgressCallback(createProgressCallback(query_context, result_rows, written_rows));
697
698 // Execute query with PostgreSQLWire output format
699 auto read_buf = std::make_unique<ReadBufferFromOwnString>(std::move(sql_query));
700 executeQuery(std::move(read_buf), *out, query_context, {});
701
702 // Determine affected rows based on command type
703 return (command == PostgreSQLProtocol::Messaging::CommandComplete::Command::INSERT)
704 ? written_rows.load()
705 : result_rows.load();
706}
707
708bool PostgreSQLHandler::processPrepareStatement(const String & query)
709{

Callers

nothing calls this directly

Calls 3

executeQueryFunction · 0.50
setProgressCallbackMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected