projects
/
users
/
simon
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c78288e
)
Properly access a buffer's LSN using existing access macros instead of abusing
author
Alvaro Herrera
<
[email protected]
>
Mon, 20 Oct 2008 21:11:15 +0000
(21:11 +0000)
committer
Alvaro Herrera
<
[email protected]
>
Mon, 20 Oct 2008 21:11:15 +0000
(21:11 +0000)
knowledge of page layout.
Stolen from Jonah Harris' CRC patch
src/backend/storage/buffer/bufmgr.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/storage/buffer/bufmgr.c
b/src/backend/storage/buffer/bufmgr.c
index 53d7819c01ecab0d0b3077773f5cb438035569a6..560293d3723eee95a8bbe2651086880009d52609 100644
(file)
--- a/
src/backend/storage/buffer/bufmgr.c
+++ b/
src/backend/storage/buffer/bufmgr.c
@@
-48,7
+48,7
@@
/* Note: these two macros only work on shared buffers, not local ones! */
#define BufHdrGetBlock(bufHdr) ((Block) (BufferBlocks + ((Size) (bufHdr)->buf_id) * BLCKSZ))
-#define BufferGetLSN(bufHdr) (
*((XLogRecPtr*)
BufHdrGetBlock(bufHdr)))
+#define BufferGetLSN(bufHdr) (
PageGetLSN(
BufHdrGetBlock(bufHdr)))
/* Note: this macro only works on local buffers, not shared ones! */
#define LocalBufHdrGetBlock(bufHdr) \