| 548 | } |
| 549 | |
| 550 | static 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 | |
| 582 | static inline AR_EXP_Result _AR_EXP_EvaluateBorrowRecord(AR_ExpNode *node, const Record r, |
| 583 | SIValue *result) { |
no test coverage detected