aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeHashjoin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeHashjoin.c')
-rw-r--r--src/backend/executor/nodeHashjoin.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index b2f1cf7fa79..43569fc58b2 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -1524,8 +1524,13 @@ void
ExecHashJoinReInitializeDSM(HashJoinState *state, ParallelContext *cxt)
{
int plan_node_id = state->js.ps.plan->plan_node_id;
- ParallelHashJoinState *pstate =
- shm_toc_lookup(cxt->toc, plan_node_id, false);
+ ParallelHashJoinState *pstate;
+
+ /* Nothing to do if we failed to create a DSM segment. */
+ if (cxt->seg == NULL)
+ return;
+
+ pstate = shm_toc_lookup(cxt->toc, plan_node_id, false);
/*
* It would be possible to reuse the shared hash table in single-batch