MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _AR_EXP_EvaluateParam

Function _AR_EXP_EvaluateParam

src/arithmetic/arithmetic_expression.c:550–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550static AR_EXP_Result _AR_EXP_EvaluateParam
551(
552 AR_ExpNode *node,
553 SIValue *result
554) {
555 SIValue *param;
556 rax *params = QueryCtx_GetParams();
557
558 if(params) {
559 param = (SIValue*)raxFind(params,
560 (unsigned char *)node->operand.param_name,
561 strlen(node->operand.param_name));
562 }
563
564 if(params == NULL || param == raxNotFound) {
565 // set the query-level error
566 ErrorCtx_SetError("Missing parameters");
567 return EVAL_ERR;
568 }
569
570 //--------------------------------------------------------------------------
571 // in place replacement
572 //--------------------------------------------------------------------------
573
574 node->operand.type = AR_EXP_CONSTANT;
575 node->operand.constant = SI_ShareValue(*param);
576
577 *result = node->operand.constant;
578
579 return EVAL_FOUND_PARAM;
580}
581
582static inline AR_EXP_Result _AR_EXP_EvaluateBorrowRecord(AR_ExpNode *node, const Record r,
583 SIValue *result) {

Callers 1

_AR_EXP_EvaluateFunction · 0.85

Calls 3

QueryCtx_GetParamsFunction · 0.85
ErrorCtx_SetErrorFunction · 0.85
SI_ShareValueFunction · 0.85

Tested by

no test coverage detected