diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-10-27 16:04:01 +0200 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-10-27 16:12:16 +0200 |
commit | 036b6bd50365b9ae6ec0b4cb21d172510ef440a9 (patch) | |
tree | 76aa358a64e802fc30794dabc2e4b7cb083dfd61 /src/backend/executor/execUtils.c | |
parent | 37b4e0fe9964fc23d6a38973eaf67b287ac199ca (diff) | |
download | postgresql-036b6bd50365b9ae6ec0b4cb21d172510ef440a9.tar.gz postgresql-036b6bd50365b9ae6ec0b4cb21d172510ef440a9.zip |
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
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r-- | src/backend/executor/execUtils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index a3bcb100dad..54c60a8d445 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -140,6 +140,8 @@ CreateExecutorState(void) estate->es_epqTupleSet = NULL; estate->es_epqScanDone = NULL; + estate->es_use_parallel_mode = false; + /* * Return the executor state structure */ |