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

Method explodeOutputs

src/dsql/StmtNodes.cpp:3165–3193  ·  view source on GitHub ↗

Generate a parameter list to correspond to procedure outputs.

Source from the content-addressed store, hash-verified

3163
3164// Generate a parameter list to correspond to procedure outputs.
3165ValueListNode* ExecProcedureNode::explodeOutputs(DsqlCompilerScratch* dsqlScratch,
3166 const dsql_prc* procedure)
3167{
3168 DEV_BLKCHK(dsqlScratch, dsql_type_req);
3169 DEV_BLKCHK(procedure, dsql_type_prc);
3170
3171 const USHORT count = procedure->prc_out_count;
3172 ValueListNode* output = FB_NEW_POOL(dsqlScratch->getPool()) ValueListNode(dsqlScratch->getPool(), count);
3173 NestConst<ValueExprNode>* ptr = output->items.begin();
3174
3175 for (const dsql_fld* field = procedure->prc_outputs; field; field = field->fld_next, ++ptr)
3176 {
3177 DEV_BLKCHK(field, dsql_type_fld);
3178
3179 ParameterNode* paramNode = FB_NEW_POOL(dsqlScratch->getPool()) ParameterNode(dsqlScratch->getPool());
3180 *ptr = paramNode;
3181
3182 dsql_par* parameter = paramNode->dsqlParameter = MAKE_parameter(
3183 dsqlScratch->getDsqlStatement()->getReceiveMsg(), true, true, 0, NULL);
3184 paramNode->dsqlParameterIndex = parameter->par_index;
3185
3186 DsqlDescMaker::fromField(&parameter->par_desc, field);
3187 parameter->par_name = parameter->par_alias = field->fld_name.c_str();
3188 parameter->par_rel_name = procedure->prc_name.identifier.c_str();
3189 parameter->par_owner_name = procedure->prc_owner.c_str();
3190 }
3191
3192 return output;
3193}
3194
3195string ExecProcedureNode::internalPrint(NodePrinter& printer) const
3196{

Callers

nothing calls this directly

Calls 7

ParameterNodeClass · 0.85
MAKE_parameterFunction · 0.85
getReceiveMsgMethod · 0.80
ValueListNodeClass · 0.70
beginMethod · 0.45
getDsqlStatementMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected