aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/storage/buffer/bufmgr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 4e44336332b..01eabe57063 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -4064,8 +4064,8 @@ local_buffer_write_error_callback(void *arg)
static int
rnode_comparator(const void *p1, const void *p2)
{
- RelFileNode n1 = *(RelFileNode *) p1;
- RelFileNode n2 = *(RelFileNode *) p2;
+ RelFileNode n1 = *(const RelFileNode *) p1;
+ RelFileNode n2 = *(const RelFileNode *) p2;
if (n1.relNode < n2.relNode)
return -1;
@@ -4174,8 +4174,8 @@ buffertag_comparator(const void *a, const void *b)
static int
ckpt_buforder_comparator(const void *pa, const void *pb)
{
- const CkptSortItem *a = (CkptSortItem *) pa;
- const CkptSortItem *b = (CkptSortItem *) pb;
+ const CkptSortItem *a = (const CkptSortItem *) pa;
+ const CkptSortItem *b = (const CkptSortItem *) pb;
/* compare tablespace */
if (a->tsId < b->tsId)
@@ -4195,8 +4195,10 @@ ckpt_buforder_comparator(const void *pa, const void *pb)
/* compare block number */
else if (a->blockNum < b->blockNum)
return -1;
- else /* should not be the same block ... */
+ else if (a->blockNum > b->blockNum)
return 1;
+ /* equal page IDs are unlikely, but not impossible */
+ return 0;
}
/*