| 147 | } |
| 148 | |
| 149 | static 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'". |
| 159 | static String killConnectionIdReplacementQuery(const String & query) |
no test coverage detected