* Push down the current stmt_mcontext so that called statements won't use it. * This is needed by statements that have statement-lifespan data and need to * preserve it across some inner statements. The caller should eventually do * pop_stmt_mcontext(). */
| 1522 | * pop_stmt_mcontext(). |
| 1523 | */ |
| 1524 | static void |
| 1525 | push_stmt_mcontext(PLpgSQL_execstate *estate) |
| 1526 | { |
| 1527 | /* Should have done get_stmt_mcontext() first */ |
| 1528 | Assert(estate->stmt_mcontext != NULL); |
| 1529 | /* Assert we've not messed up the stack linkage */ |
| 1530 | Assert(MemoryContextGetParent(estate->stmt_mcontext) == estate->stmt_mcontext_parent); |
| 1531 | /* Push it down to become the parent of any nested stmt mcontext */ |
| 1532 | estate->stmt_mcontext_parent = estate->stmt_mcontext; |
| 1533 | /* And make it not available for use directly */ |
| 1534 | estate->stmt_mcontext = NULL; |
| 1535 | } |
| 1536 | |
| 1537 | /* |
| 1538 | * Undo push_stmt_mcontext(). We assume this is done just before or after |
no test coverage detected