Repository navigation
PostgreSQL: Support the VARIADIC function call argument marker - #2484
LucaCappelletti94 wants to merge 6 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 82.29% 82.33% +0.04%
==========================================
Files 42 42
Lines 35315 35396 +81
Branches 35315 35396 +81
==========================================
+ Hits 29061 29143 +82
Misses 2695 2695
+ Partials 3559 3558 -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.
0254c61 to
86861b4
Compare
86861b4 to
3f68d03
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.