| 475 | } |
| 476 | |
| 477 | static PLyExecutionContext * |
| 478 | PLy_push_execution_context(bool atomic_context) |
| 479 | { |
| 480 | PLyExecutionContext *context; |
| 481 | |
| 482 | /* Pick a memory context similar to what SPI uses. */ |
| 483 | context = (PLyExecutionContext *) |
| 484 | MemoryContextAlloc(atomic_context ? TopTransactionContext : PortalContext, |
| 485 | sizeof(PLyExecutionContext)); |
| 486 | context->curr_proc = NULL; |
| 487 | context->scratch_ctx = NULL; |
| 488 | context->next = PLy_execution_contexts; |
| 489 | PLy_execution_contexts = context; |
| 490 | return context; |
| 491 | } |
| 492 | |
| 493 | static void |
| 494 | PLy_pop_execution_context(void) |
no test coverage detected