Repository navigation
PostgreSQL: Support the VARIADIC function call argument marker - #2484
LucaCappelletti94 wants to merge 3 commits into
Conversation
e358745 to
66f00a5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2484 +/- ##
==========================================
+ Coverage 81.28% 81.37% +0.09%
==========================================
Files 42 42
Lines 33920 34074 +154
Branches 33920 34074 +154
==========================================
+ Hits 27571 27727 +156
+ Misses 2785 2784 -1
+ Partials 3564 3563 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
94a4362 to
efb39cc
Compare
efb39cc to
b959e40
Compare
b959e40 to
9212127
Compare
sabir-akhadov-localstack
left a comment
There was a problem hiding this comment.
One non-blocking comment inline.
| arg, | ||
| operator: _, | ||
| } => name.span().union(&arg.span()), | ||
| FunctionArg::Variadic(arg) => arg.span(), |
There was a problem hiding this comment.
This span starts at the operand, so for SELECT f(VARIADIC a, b) the "must be the last function argument" error points at a rather than at VARIADIC; capturing the keyword's span (or using self.peek_token_ref().span.start in the position check) would put it on the marker.
There was a problem hiding this comment.
Fixed it, but span really is a mess of its own and we'll have to handle it some time after the tokenizer refactoring. Thanks for pointing this one out.
PostgreSqlDialectcould not parse theVARIADICargument marker in a function call, in any position:The marker is added as
FunctionArg::Variadic. Parsing is gated onDialect::supports_variadic_function_argument, enabled forPostgreSQLand the generic dialect.As in
PostgreSQL, the marker is rejected on a wildcard operand, in combination withDISTINCTorALL, and on any but the final argument.