Repository navigation
Conversation
CALL passes an argument for the OUT parameters of a procedure too, so the call signatures of procedures now include them, like Postgres does with include_out_arguments. Procedures created in the file return record or void, so their calls resolve too.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #914.
#914 resolved
CALL, but skipped procedures withOUTorINOUTparameters, and procedures created in the file never resolved at all.What was wrong
CALLpasses an argument for every parameter of a procedure,OUTincluded (usuallyNULL).ParseFuncOrColumnlooks the candidates up withinclude_out_argumentsfor aCALL(FuncnameGetCandidates,namespace.c#L1272at REL_18_6), andtransformCallStmtsplits the output arguments off afterwards. Our signatures only had the input arguments, so the arguments didn't line up, and feat(catalog): keep editor features working after DO, CALL and unparsable statements; resolve CALL #914 skipped every procedure with output parameters.select_functiongives up without one, soCALLof a procedure from the same file never resolved.What changed
FunctionArgumentMode::Out: the signature of a procedure now includes itsOUTarguments, from the snapshot (base.rs) and fromCREATE PROCEDUREin the file.min_args/max_argscount them too. Functions are unchanged, and so isinput_types, whichDROP/ALTERmatching uses.CREATE PROCEDUREin the file rejects anOUTparameter after one with a default, like Postgres does, and the procedure returnsrecordwith output parameters andvoidwithout (CreateFunction,functioncmds.c#L1188).resolve_procedure_callno longer skips procedures with output parameters.OUTarguments.Tests
pgls_catalog:CALLof procedures withOUTandINOUTparameters from the database and from the file; a call that leaves out theOUTargument matches nothing.pgls_inlay_hints: hints for all three kinds of parameters.pgls_hover: snapshot for hovering a procedure with anOUTparameter inCALL.Not covered
CALL, Postgres also includes the output arguments of functions with the same name when it picks a candidate (the call then fails because they aren't procedures). We don't, so a function and a procedure with the same name could resolve differently in rare overload cases. We only record a reference when the match is a procedure.select proc(...)of a procedure with output parameters now gets an argument-count finding instead of none. Postgres rejects the statement either way ("is a procedure").