summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane2016-08-19 18:35:32 +0000
committerTom Lane2016-08-19 18:35:32 +0000
commit65a603e90328a7a8fb3ab30ed96f24bf8eb4cf84 (patch)
tree1904d298fe576797ebaaa7a0968adf14e49170b5 /src
parentda1c91631e3577ea5818f855ebb5bd206d559006 (diff)
Guard against parallel-restricted functions in VALUES expressions.
Obvious brain fade in set_rel_consider_parallel(). Noticed it while adjusting the adjacent RTE_FUNCTION case. In 9.6, also make the code look more like what I just did in HEAD by removing the unnecessary function_rte_parallel_ok subroutine (it does nothing that expression_tree_walker wouldn't do).
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/path/allpaths.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index af73792227d..04264b43359 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -599,11 +599,9 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel,
break;
case RTE_VALUES:
-
- /*
- * The data for a VALUES clause is stored in the plan tree itself,
- * so scanning it in a worker is fine.
- */
+ /* Check for parallel-restricted functions. */
+ if (!is_parallel_safe(root, (Node *) rte->values_lists))
+ return;
break;
case RTE_CTE: