| 132 | |
| 133 | |
| 134 | static void tryFindInputFunctionImpl(const ASTPtr & ast, ASTPtr & input_function) |
| 135 | { |
| 136 | if (!ast) |
| 137 | return; |
| 138 | for (const auto & child : ast->children) |
| 139 | tryFindInputFunctionImpl(child, input_function); |
| 140 | |
| 141 | if (const auto * table_function_ast = ast->as<ASTFunction>()) |
| 142 | { |
| 143 | if (table_function_ast->name == "input") |
| 144 | { |
| 145 | if (input_function) |
| 146 | throw Exception("You can use 'input()' function only once per request.", ErrorCodes::INVALID_USAGE_OF_INPUT); |
| 147 | input_function = ast; |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | |
| 153 | void ASTInsertQuery::tryFindInputFunction(ASTPtr & input_function) const |
no test coverage detected