• Tom Lane's avatar
    Fix possible failures when a tuplestore switches from in-memory to on-disk · 25bf7f8b
    Tom Lane authored
    mode while callers hold pointers to in-memory tuples.  I reported this for
    the case of nodeWindowAgg's primary scan tuple, but inspection of the code
    shows that all of the calls in nodeWindowAgg and nodeCtescan are at risk.
    For the moment, fix it with a rather brute-force approach of copying
    whenever one of the at-risk callers requests a tuple.  Later we might
    think of some sort of reference-count approach to reduce tuple copying.
    25bf7f8b
tuplestore.c 36.5 KB