* plpgsql_subxact_cb --- post-subtransaction-commit-or-abort cleanup * * Make sure any simple-expression econtexts created in the current * subtransaction get cleaned up. We have to do this explicitly because * no other code knows which econtexts belong to which level of subxact. */
| 8368 | * no other code knows which econtexts belong to which level of subxact. |
| 8369 | */ |
| 8370 | void |
| 8371 | plpgsql_subxact_cb(SubXactEvent event, SubTransactionId mySubid, |
| 8372 | SubTransactionId parentSubid, void *arg) |
| 8373 | { |
| 8374 | if (event == SUBXACT_EVENT_COMMIT_SUB || event == SUBXACT_EVENT_ABORT_SUB) |
| 8375 | { |
| 8376 | while (simple_econtext_stack != NULL && |
| 8377 | simple_econtext_stack->xact_subxid == mySubid) |
| 8378 | { |
| 8379 | SimpleEcontextStackEntry *next; |
| 8380 | |
| 8381 | FreeExprContext(simple_econtext_stack->stack_econtext, |
| 8382 | (event == SUBXACT_EVENT_COMMIT_SUB)); |
| 8383 | next = simple_econtext_stack->next; |
| 8384 | pfree(simple_econtext_stack); |
| 8385 | simple_econtext_stack = next; |
| 8386 | } |
| 8387 | } |
| 8388 | } |
| 8389 | |
| 8390 | /* |
| 8391 | * assign_simple_var --- assign a new value to any VAR datum. |
no test coverage detected