1 | #include "duckdb/parser/expression/parameter_expression.hpp" |
---|---|
2 | #include "duckdb/parser/transformer.hpp" |
3 | |
4 | using namespace duckdb; |
5 | using namespace std; |
6 | |
7 | unique_ptr<ParsedExpression> Transformer::TransformParamRef(PGParamRef *node) { |
8 | if (!node) { |
9 | return nullptr; |
10 | } |
11 | auto expr = make_unique<ParameterExpression>(); |
12 | if (node->number == 0) { |
13 | expr->parameter_nr = ParamCount() + 1; |
14 | } else { |
15 | expr->parameter_nr = node->number; |
16 | } |
17 | SetParamCount(max(ParamCount(), expr->parameter_nr)); |
18 | return move(expr); |
19 | } |
20 |