* Creates the Param values for the BSON types. * We do this as a BYTEA param so that Citus can * force the bson as a binary to the worker nodes * which can improve perf in multi-node scenarios. */
| 544 | * which can improve perf in multi-node scenarios. |
| 545 | */ |
| 546 | inline static Expr * |
| 547 | CreateBsonParam(int paramIndex, ParamListInfo paramListInfo, pgbson *bsonValue) |
| 548 | { |
| 549 | Assert(paramListInfo->numParams > paramIndex); |
| 550 | |
| 551 | Param *bsonValueParam = makeNode(Param); |
| 552 | bsonValueParam->paramid = paramIndex + 1; |
| 553 | bsonValueParam->paramkind = PARAM_EXTERN; |
| 554 | bsonValueParam->paramtype = BYTEAOID; |
| 555 | bsonValueParam->paramtypmod = -1; |
| 556 | paramListInfo->params[paramIndex].isnull = false; |
| 557 | paramListInfo->params[paramIndex].pflags = PARAM_FLAG_CONST; |
| 558 | paramListInfo->params[paramIndex].ptype = BYTEAOID; |
| 559 | paramListInfo->params[paramIndex].value = PointerGetDatum(bsonValue); |
| 560 | paramIndex++; |
| 561 | |
| 562 | return (Expr *) makeRelabelType((Expr *) bsonValueParam, BsonTypeId(), -1, InvalidOid, |
| 563 | COERCE_IMPLICIT_CAST); |
| 564 | } |
| 565 | |
| 566 | |
| 567 | /* |
no test coverage detected