* Compute old array element 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. */
| 396 | * prevvalue/prevnull fields. |
| 397 | */ |
| 398 | static void |
| 399 | array_subscript_fetch_old(ExprState *state, |
| 400 | ExprEvalStep *op, |
| 401 | ExprContext *econtext) |
| 402 | { |
| 403 | SubscriptingRefState *sbsrefstate = op->d.sbsref.state; |
| 404 | ArraySubWorkspace *workspace = (ArraySubWorkspace *) sbsrefstate->workspace; |
| 405 | |
| 406 | if (*op->resnull) |
| 407 | { |
| 408 | /* whole array is null, so any element is too */ |
| 409 | sbsrefstate->prevvalue = (Datum) 0; |
| 410 | sbsrefstate->prevnull = true; |
| 411 | } |
| 412 | else |
| 413 | sbsrefstate->prevvalue = array_get_element(*op->resvalue, |
| 414 | sbsrefstate->numupper, |
| 415 | workspace->upperindex, |
| 416 | workspace->refattrlength, |
| 417 | workspace->refelemlength, |
| 418 | workspace->refelembyval, |
| 419 | workspace->refelemalign, |
| 420 | &sbsrefstate->prevnull); |
| 421 | } |
| 422 | |
| 423 | /* |
| 424 | * Compute old array slice value for a SubscriptingRef assignment |
nothing calls this directly
no test coverage detected