aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/funcs_new.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-05-13 09:44:43 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-05-13 09:53:50 +0300
commit462a2f1f019fa16087fe2f59e96e339a703923b2 (patch)
treea20150bc9308e86c2a56e551b814d5811e2dcdf9 /src/tutorial/funcs_new.c
parent4d3d9719d28ff9956540c36a05a4846b55b0234b (diff)
downloadpostgresql-462a2f1f019fa16087fe2f59e96e339a703923b2.tar.gz
postgresql-462a2f1f019fa16087fe2f59e96e339a703923b2.zip
Fix RBM_ZERO_AND_LOCK mode to not acquire lock on local buffers.
Commit 81c45081 introduced a new RBM_ZERO_AND_LOCK mode to ReadBuffer, which takes a lock on the buffer before zeroing it. However, you cannot take a lock on a local buffer, and you got a segfault instead. The version of that patch committed to master included a check for !isLocalBuf, and therefore didn't crash, but oddly I missed that in the back-patched versions. This patch adds that check to the back-branches too. RBM_ZERO_AND_LOCK mode is only used during WAL replay, and in hash indexes. WAL replay only deals with shared buffers, so the only way to trigger the bug is with a temporary hash index. Reported by Artem Ignatyev, analysis by Tom Lane.
Diffstat (limited to 'src/tutorial/funcs_new.c')
0 files changed, 0 insertions, 0 deletions