]> granicus.if.org Git - postgresql/commit
Fix possible failures when a tuplestore switches from in-memory to on-disk
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Mar 2009 18:30:21 +0000 (18:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 27 Mar 2009 18:30:21 +0000 (18:30 +0000)
commit25bf7f8b9b3ce0f04b498988bb98d9d5cf9bad67
tree9d96a158b6c03def3242d5d4af85d843cd5490e0
parenta95307b639ad94fb94c898eb6b4a3c95c407bf44
Fix possible failures when a tuplestore switches from in-memory to on-disk
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.
src/backend/executor/execQual.c
src/backend/executor/functions.c
src/backend/executor/nodeCtescan.c
src/backend/executor/nodeFunctionscan.c
src/backend/executor/nodeMaterial.c
src/backend/executor/nodeWindowAgg.c
src/backend/executor/nodeWorktablescan.c
src/backend/tcop/pquery.c
src/backend/utils/sort/tuplestore.c
src/include/utils/tuplestore.h