| 419 | } |
| 420 | |
| 421 | void |
| 422 | ExecReScanAppend(AppendState *node) |
| 423 | { |
| 424 | int nasyncplans = node->as_nasyncplans; |
| 425 | int i; |
| 426 | |
| 427 | /* |
| 428 | * If any PARAM_EXEC Params used in pruning expressions have changed, then |
| 429 | * we'd better unset the valid subplans so that they are reselected for |
| 430 | * the new parameter values. |
| 431 | */ |
| 432 | if (node->as_prune_state && |
| 433 | bms_overlap(node->ps.chgParam, |
| 434 | node->as_prune_state->execparamids)) |
| 435 | { |
| 436 | bms_free(node->as_valid_subplans); |
| 437 | node->as_valid_subplans = NULL; |
| 438 | if (nasyncplans > 0) |
| 439 | { |
| 440 | bms_free(node->as_valid_asyncplans); |
| 441 | node->as_valid_asyncplans = NULL; |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | for (i = 0; i < node->as_nplans; i++) |
| 446 | { |
| 447 | PlanState *subnode = node->appendplans[i]; |
| 448 | |
| 449 | /* |
| 450 | * ExecReScan doesn't know about my subplans, so I have to do |
| 451 | * changed-parameter signaling myself. |
| 452 | */ |
| 453 | if (node->ps.chgParam != NULL) |
| 454 | UpdateChangedParamSet(subnode, node->ps.chgParam); |
| 455 | |
| 456 | /* |
| 457 | * If chgParam of subnode is not null then plan will be re-scanned by |
| 458 | * first ExecProcNode or by first ExecAsyncRequest. |
| 459 | */ |
| 460 | if (subnode->chgParam == NULL) |
| 461 | ExecReScan(subnode); |
| 462 | } |
| 463 | |
| 464 | /* Reset async state */ |
| 465 | if (nasyncplans > 0) |
| 466 | { |
| 467 | i = -1; |
| 468 | while ((i = bms_next_member(node->as_asyncplans, i)) >= 0) |
| 469 | { |
| 470 | AsyncRequest *areq = node->as_asyncrequests[i]; |
| 471 | |
| 472 | areq->callback_pending = false; |
| 473 | areq->request_complete = false; |
| 474 | areq->result = NULL; |
| 475 | } |
| 476 | |
| 477 | node->as_nasyncresults = 0; |
| 478 | node->as_nasyncremain = 0; |
no test coverage detected