From 639c1a6bb9ee08fe4757a6fab1ddbd01291515e1 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 27 Oct 2017 16:04:01 +0200 Subject: Fix mistaken failure to allow parallelism in corner case. If we try to run a parallel plan in serial mode because, for example, it's going to be scanned via a cursor, but for some reason we're already in parallel mode (for example because an outer query is running in parallel), we'd incorrectly try to launch workers. Fix by adding a flag to the EState, so that we can be certain that ExecutePlan() and ExecGather()/ExecGatherMerge() will have the same idea about whether we are executing serially or in parallel. Report and fix by Amit Kapila with help from Kuntal Ghosh. A few tweaks by me. Discussion: http://postgr.es/m/CAA4eK1+_BuZrmVCeua5Eqnm4Co9DAXdM5HPAOE2J19ePbR912Q@mail.gmail.com --- src/backend/executor/execUtils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/backend/executor/execUtils.c') diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index ee6c4af0550..e8c06c76056 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -156,6 +156,8 @@ CreateExecutorState(void) estate->es_epqScanDone = NULL; estate->es_sourceText = NULL; + estate->es_use_parallel_mode = false; + /* * Return the executor state structure */ -- cgit v1.2.3