MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / act_procedure

Function act_procedure

src/gpre/sql.cpp:4002–4078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4000//
4001
4002static act* act_procedure()
4003{
4004 gpre_req* request = MSC_request(REQ_procedure);
4005 par_options(&request->req_trans);
4006
4007 SCHAR p_name[NAME_SIZE], db_name[NAME_SIZE], owner_name[NAME_SIZE];
4008
4009 SQL_relation_name(p_name, db_name, owner_name);
4010 gpre_prc* procedure = SQL_procedure(request, p_name, db_name, owner_name, true);
4011
4012 gpre_lls* values = NULL;
4013
4014 SSHORT inputs = 0;
4015 if (gpreGlob.token_global.tok_keyword != KW_RETURNING_VALUES &&
4016 gpreGlob.token_global.tok_keyword != KW_SEMI_COLON)
4017 {
4018 // parse input references
4019
4020 const bool paren = MSC_match(KW_LEFT_PAREN);
4021 gpre_fld* field = procedure->prc_inputs;
4022 ref** ref_ptr = &request->req_values;
4023 do {
4024 if (MSC_match(KW_NULL))
4025 MSC_push(MSC_node(nod_null, 0), &values);
4026 else
4027 {
4028 ref* reference = SQE_parameter(request);
4029 *ref_ptr = reference;
4030 reference->ref_field = field;
4031 MSC_push(MSC_unary(nod_value, (gpre_nod*) reference), &values);
4032 ref_ptr = &reference->ref_next;
4033 }
4034 if (field)
4035 field = field->fld_next;
4036 inputs++;
4037 } while (MSC_match(KW_COMMA));
4038 if (paren)
4039 EXP_match_paren();
4040 }
4041
4042 SSHORT outputs = 0;
4043 if (MSC_match(KW_RETURNING_VALUES))
4044 {
4045 // parse output references
4046
4047 const bool paren = MSC_match(KW_LEFT_PAREN);
4048 gpre_fld* field = procedure->prc_outputs;
4049 ref** ref_ptr = &request->req_references;
4050 do {
4051 ref* reference = (ref*) SQE_variable(request, false, NULL, NULL);
4052 *ref_ptr = reference;
4053 if ((reference->ref_field = field))
4054 field = field->fld_next;
4055 ref_ptr = &reference->ref_next;
4056 outputs++;
4057 } while (MSC_match(KW_COMMA));
4058 if (paren)
4059 EXP_match_paren();

Callers 1

act_executeFunction · 0.85

Calls 15

MSC_requestFunction · 0.85
SQL_relation_nameFunction · 0.85
SQL_procedureFunction · 0.85
MSC_matchFunction · 0.85
MSC_pushFunction · 0.85
MSC_nodeFunction · 0.85
SQE_parameterFunction · 0.85
MSC_unaryFunction · 0.85
EXP_match_parenFunction · 0.85
SQE_variableFunction · 0.85
MSC_popFunction · 0.85
MSC_actionFunction · 0.85

Tested by

no test coverage detected