mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Move interrupt checking from ExecProcNode() to executor nodes.
In a followup commit ExecProcNode(), and especially the large switch it contains, will largely be replaced by a function pointer directly to the correct node. The node functions will then get invoked by a thin inline function wrapper. To avoid having to include miscadmin.h in headers - CHECK_FOR_INTERRUPTS() - move the interrupt checks into the individual executor routines. While looking through all executor nodes, I noticed a number of arguably missing interrupt checks, add these too. Author: Andres Freund, Tom Lane Reviewed-By: Tom Lane Discussion: https://postgr.es/m/22833.1490390175@sss.pgh.pa.us
This commit is contained in:
@ -677,6 +677,8 @@ fetch_input_tuple(AggState *aggstate)
|
||||
|
||||
if (aggstate->sort_in)
|
||||
{
|
||||
/* make sure we check for interrupts in either path through here */
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
if (!tuplesort_gettupleslot(aggstate->sort_in, true, false,
|
||||
aggstate->sort_slot, NULL))
|
||||
return NULL;
|
||||
@ -1414,6 +1416,8 @@ process_ordered_aggregate_multi(AggState *aggstate,
|
||||
while (tuplesort_gettupleslot(pertrans->sortstates[aggstate->current_set],
|
||||
true, true, slot1, &newAbbrevVal))
|
||||
{
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
|
||||
/*
|
||||
* Extract the first numTransInputs columns as datums to pass to the
|
||||
* transfn. (This will help execTuplesMatch too, so we do it
|
||||
@ -2100,6 +2104,8 @@ ExecAgg(AggState *node)
|
||||
{
|
||||
TupleTableSlot *result = NULL;
|
||||
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
|
||||
if (!node->agg_done)
|
||||
{
|
||||
/* Dispatch based on strategy */
|
||||
@ -2563,6 +2569,8 @@ agg_retrieve_hash_table(AggState *aggstate)
|
||||
TupleTableSlot *hashslot = perhash->hashslot;
|
||||
int i;
|
||||
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
|
||||
/*
|
||||
* Find the next entry in the hash table
|
||||
*/
|
||||
|
Reference in New Issue
Block a user