-
由 Heikki Linnakangas 提交于
The printablePredicate of a static PartitionSelector node contains Var nodes with varno=INNER. That's bogus, because the PartitionSelector node doesn't actually have any child nodes, but works at execution time because the printablePredicate is not only used by EXPLAIN. In most cases, it still worked, because most Var nodes carry a varnoold field, which is used by EXPLAIN for the lookup, but there was one case of "bogus varno" error even memorized in the expected output of the regression suite. (PostgreSQL 8.3 changed the way EXPLAIN resolves the printable name so that varnoold no longer saves the bacon, and you would get a lot more of those errors) To fix, teach the EXPLAIN of a Sequence node to also reach into the static PartitionSelector node, and print the printablePredicate as if that qual was part of the Sequence node directly. The user-visible effect of this is that the static Partition Selector expression now appears in EXPLAIN output as a direct attribute of the Sequence node, not as a separate child node. Also, if a static Partition Selector doesn't have a "printablePredicate", i.e. it doesn't actually do any selection, it's not printed at all.
5dc7dda9