]> granicus.if.org Git - postgresql/commitdiff
Guard against parallel-restricted functions in VALUES expressions.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 19 Aug 2016 18:35:32 +0000 (14:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 19 Aug 2016 18:35:32 +0000 (14:35 -0400)
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).

src/backend/optimizer/path/allpaths.c

index af73792227d02f4529fd4f8b3aedc125d7caf1bc..04264b43359f37330d7ba42d7ccb2e5d48a16838 100644 (file)
@@ -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: