Correct nasty error in heap_update: it was releasing the buffer refcount
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Jan 2001 22:14:31 +0000 (22:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Jan 2001 22:14:31 +0000 (22:14 +0000)
commit5fc4cb91ce1d42e07d5a4007f9e8545276cce294
treededba40a21bf73b02e16fad8d22dabb323546171
parent8b6af136b76e524cb6e92532a691aa01c8e10640
Correct nasty error in heap_update: it was releasing the buffer refcount
before calling RelationInvalidateHeapTuple(), which is bad because the
latter needs to look at the tuple data, which is in the shared disk
buffer.  If another backend manages to recycle the buffer while this
is going on, we will compute the wrong hashindex for the tuple or
maybe even crash outright.  Must hold buffer refcount until afterwards.
(This bug is not in 7.0.*; seems to be have introduced during WAL changes.)
src/backend/access/heap/heapam.c