| 303 | } |
| 304 | |
| 305 | void MutationCommands::readText(ReadBuffer & in, bool with_pure_metadata_commands) |
| 306 | { |
| 307 | String commands_str; |
| 308 | readEscapedString(commands_str, in); |
| 309 | |
| 310 | ParserAlterCommandList p_alter_commands; |
| 311 | auto commands_ast = parseQuery( |
| 312 | p_alter_commands, commands_str.data(), commands_str.data() + commands_str.length(), "mutation commands list", 0, DBMS_DEFAULT_MAX_PARSER_DEPTH, DBMS_DEFAULT_MAX_PARSER_BACKTRACKS); |
| 313 | |
| 314 | for (const auto & child : commands_ast->children) |
| 315 | { |
| 316 | auto * command_ast = child->as<ASTAlterCommand>(); |
| 317 | auto command = MutationCommand::parse(*command_ast, true, with_pure_metadata_commands); |
| 318 | if (!command) |
| 319 | throw Exception(ErrorCodes::UNKNOWN_MUTATION_COMMAND, "Unknown mutation command type: {}", DB::toString<int>(command_ast->type)); |
| 320 | push_back(std::move(*command)); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | std::string MutationCommands::toString(bool with_pure_metadata_commands) const |
| 325 | { |
nothing calls this directly
no test coverage detected