]> granicus.if.org Git - postgresql/commitdiff
Remove bogus Assert in make_partitionedrel_pruneinfo().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Aug 2018 00:02:10 +0000 (20:02 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Aug 2018 00:02:32 +0000 (20:02 -0400)
This Assert thought that a given rel couldn't be both leaf and
non-leaf, but it turns out that in some unusual plan trees
that's wrong, so remove it.

The lack of testing for cases like that is quite concerning ---
there is little reason for confidence that there aren't other
bugs in the area.  But developing a stable test case seems
rather difficult, and in any case we don't need this Assert.

David Rowley

Discussion: https://postgr.es/m/CAJGNTeOkdk=UVuMugmKL7M=owgt4nNr1wjxMg1F+mHsXyLCzFA@mail.gmail.com

src/backend/partitioning/partprune.c

index 7fb53e6446d07656f10b64de8b10424cc009acaf..0dd55ac1ba3dc411810c1750f475da834848027e 100644 (file)
@@ -347,8 +347,6 @@ make_partitionedrel_pruneinfo(PlannerInfo *root, RelOptInfo *parentrel,
                Assert(rti < root->simple_rel_array_size);
                /* No duplicates please */
                Assert(relid_subpart_map[rti] == 0);
-               /* Same rel cannot be both leaf and non-leaf */
-               Assert(relid_subplan_map[rti] == 0);
 
                relid_subpart_map[rti] = i++;
        }