Skip to content

Commit 7032f42

Browse files
committed
The child relation can be null in copy
1 parent 2a64232 commit 7032f42

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/backend/cdb/cdbpathlocus.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,21 +1058,21 @@ cdbpathlocus_is_hashed_on_tlist(CdbPathLocus locus, List *tlist,
10581058
if (ignore_constants && CdbEquivClassIsConstant(dk_eclass))
10591059
continue;
10601060

1061-
if (dk_eclass->ec_sortref != 0)
1062-
{
1063-
foreach(i, tlist)
1064-
{
1065-
TargetEntry *tle = (TargetEntry *) lfirst(i);
1066-
1067-
if (tle->ressortgroupref == dk_eclass->ec_sortref)
1068-
{
1069-
found = true;
1070-
break;
1071-
}
1072-
}
1073-
}
1074-
else
1075-
{
1061+
// if (dk_eclass->ec_sortref != 0)
1062+
// {
1063+
// foreach(i, tlist)
1064+
// {
1065+
// TargetEntry *tle = (TargetEntry *) lfirst(i);
1066+
//
1067+
// if (tle->ressortgroupref == dk_eclass->ec_sortref)
1068+
// {
1069+
// found = true;
1070+
// break;
1071+
// }
1072+
// }
1073+
// }
1074+
// else
1075+
// {
10761076
foreach(i, dk_eclass->ec_members)
10771077
{
10781078
EquivalenceMember *em = (EquivalenceMember *) lfirst(i);
@@ -1091,7 +1091,7 @@ cdbpathlocus_is_hashed_on_tlist(CdbPathLocus locus, List *tlist,
10911091
if (found)
10921092
break;
10931093
}
1094-
}
1094+
// }
10951095
if (!found)
10961096
return false;
10971097
}

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9380,7 +9380,8 @@ apply_scanjoin_target_to_paths(PlannerInfo *root,
93809380
int nappinfos;
93819381
List *child_scanjoin_targets = NIL;
93829382

9383-
Assert(child_rel != NULL);
9383+
if (child_rel == NULL)
9384+
continue;
93849385

93859386
/* Dummy children can be ignored. */
93869387
if (IS_DUMMY_REL(child_rel))

0 commit comments

Comments
 (0)