Repository navigation
PostgreSQL: Support the VARIADIC function call argument marker - #2484
LucaCappelletti94 wants to merge 4 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.84% 81.90% +0.05%
==========================================
Files 42 42
Lines 34667 34764 +97
Branches 34667 34764 +97
==========================================
+ Hits 28373 28472 +99
+ Misses 2753 2752 -1
+ Partials 3541 3540 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
94a4362 to
efb39cc
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.
8707007 to
a26e66a
Compare
a26e66a to
01e8b71
Compare
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.