MCPcopy Create free account
hub / github.com/apache/cloudberry / array_subscript_fetch_old_slice

Function array_subscript_fetch_old_slice

src/backend/utils/adt/arraysubs.c:438–467  ·  view source on GitHub ↗

* Compute old array slice value for a SubscriptingRef assignment * expression. Will only be called if the new-value subexpression * contains SubscriptingRef or FieldStore. This is the same as the * regular fetch case, except that we have to handle a null array, * and the value should be stored into the SubscriptingRefState's * prevvalue/prevnull fields. * * Note: this is presently dead co

Source from the content-addressed store, hash-verified

436 * reachable, however.
437 */
438static void
439array_subscript_fetch_old_slice(ExprState *state,
440 ExprEvalStep *op,
441 ExprContext *econtext)
442{
443 SubscriptingRefState *sbsrefstate = op->d.sbsref.state;
444 ArraySubWorkspace *workspace = (ArraySubWorkspace *) sbsrefstate->workspace;
445
446 if (*op->resnull)
447 {
448 /* whole array is null, so any slice is too */
449 sbsrefstate->prevvalue = (Datum) 0;
450 sbsrefstate->prevnull = true;
451 }
452 else
453 {
454 sbsrefstate->prevvalue = array_get_slice(*op->resvalue,
455 sbsrefstate->numupper,
456 workspace->upperindex,
457 workspace->lowerindex,
458 sbsrefstate->upperprovided,
459 sbsrefstate->lowerprovided,
460 workspace->refattrlength,
461 workspace->refelemlength,
462 workspace->refelembyval,
463 workspace->refelemalign);
464 /* slices of non-null arrays are never null */
465 sbsrefstate->prevnull = false;
466 }
467}
468
469/*
470 * Set up execution state for an array subscript operation.

Callers

nothing calls this directly

Calls 1

array_get_sliceFunction · 0.85

Tested by

no test coverage detected