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

Function setSettingReplacementQuery

src/Server/MySQLHandler.cpp:149–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149static std::optional<String> setSettingReplacementQuery(const String & query, const String & mysql_setting, const String & clickhouse_setting)
150{
151 const String prefix = "SET " + mysql_setting;
152 // if (query.length() >= prefix.length() && boost::iequals(std::string_view(prefix), std::string_view(query.data(), 3)))
153 if (checkShouldReplaceQuery(query, prefix))
154 return "SET " + clickhouse_setting + String(query.data() + prefix.length());
155 return std::nullopt;
156}
157
158/// Replace "KILL QUERY [connection_id]" into "KILL QUERY WHERE query_id LIKE 'mysql:[connection_id]:xxx'".
159static String killConnectionIdReplacementQuery(const String & query)

Callers 1

comQueryMethod · 0.85

Calls 4

checkShouldReplaceQueryFunction · 0.85
StringClass · 0.50
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected