• Tom Lane's avatar
    Fix bug with whole-row references to append subplans. · d6858148
    Tom Lane authored
    ExecEvalWholeRowVar incorrectly supposed that it could "bless" the source
    TupleTableSlot just once per query.  But if the input is coming from an
    Append (or, perhaps, other cases?) more than one slot might be returned
    over the query run.  This led to "record type has not been registered"
    errors when a composite datum was extracted from a non-blessed slot.
    
    This bug has been there a long time; I guess it escaped notice because when
    dealing with subqueries the planner tends to expand whole-row Vars into
    RowExprs, which don't have the same problem.  It is possible to trigger
    the problem in all active branches, though, as illustrated by the added
    regression test.
    d6858148
subselect.out 21 KB