OSDN Git Service

Catch up core's change.
authorKyotaro Horiguchi <horikyota.ntt@gmail.com>
Thu, 20 Feb 2020 06:21:30 +0000 (15:21 +0900)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Thu, 20 Feb 2020 06:21:30 +0000 (15:21 +0900)
The commits 2f78974e29 and 71288846ef affected core.c. Catch up them.

core.c

diff --git a/core.c b/core.c
index dc5a588..699179b 100644 (file)
--- a/core.c
+++ b/core.c
@@ -1094,6 +1094,10 @@ join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
                                {
                                        SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(l);
 
+                                       /* ignore full joins --- their ordering is predetermined */
+                                       if (sjinfo->jointype == JOIN_FULL)
+                                               continue;
+
                                        if (bms_overlap(sjinfo->min_lefthand, join_plus_rhs) &&
                                                !bms_is_subset(sjinfo->min_righthand, join_plus_rhs))
                                        {
@@ -1101,15 +1105,6 @@ join_is_legal(PlannerInfo *root, RelOptInfo *rel1, RelOptInfo *rel2,
                                                                                                          sjinfo->min_righthand);
                                                more = true;
                                        }
-                                       /* full joins constrain both sides symmetrically */
-                                       if (sjinfo->jointype == JOIN_FULL &&
-                                               bms_overlap(sjinfo->min_righthand, join_plus_rhs) &&
-                                               !bms_is_subset(sjinfo->min_lefthand, join_plus_rhs))
-                                       {
-                                               join_plus_rhs = bms_add_members(join_plus_rhs,
-                                                                                                               sjinfo->min_lefthand);
-                                               more = true;
-                                       }
                                }
                        } while (more);
                        if (bms_overlap(join_plus_rhs, join_lateral_rels))
@@ -1216,7 +1211,8 @@ mark_dummy_rel(RelOptInfo *rel)
        rel->pathlist = NIL;
 
        /* Set up the dummy path */
-       add_path(rel, (Path *) create_append_path(rel, NIL, NULL));
+       add_path(rel, (Path *) create_append_path(rel, NIL,
+                                                                                         rel->lateral_relids));
 
        /* Set or update cheapest_total_path and related fields */
        set_cheapest(rel);