* Create a memory context for statement-lifespan variables, if we don't * have one already. It will be a child of stmt_mcontext_parent, which is * either the function's main context or a pushed-down outer stmt_mcontext. */
| 1503 | * either the function's main context or a pushed-down outer stmt_mcontext. |
| 1504 | */ |
| 1505 | static MemoryContext |
| 1506 | get_stmt_mcontext(PLpgSQL_execstate *estate) |
| 1507 | { |
| 1508 | if (estate->stmt_mcontext == NULL) |
| 1509 | { |
| 1510 | estate->stmt_mcontext = |
| 1511 | AllocSetContextCreate(estate->stmt_mcontext_parent, |
| 1512 | "PLpgSQL per-statement data", |
| 1513 | ALLOCSET_DEFAULT_SIZES); |
| 1514 | } |
| 1515 | return estate->stmt_mcontext; |
| 1516 | } |
| 1517 | |
| 1518 | /* |
| 1519 | * Push down the current stmt_mcontext so that called statements won't use it. |
no outgoing calls
no test coverage detected