Found these warnings while compiling while only 0001 is applied.

[1166/2337] Compiling C object src/backend/postgres_lib.a.p/storage_smgr_md.c.o
../src/backend/storage/smgr/md.c: In function ‘mdexists’:
../src/backend/storage/smgr/md.c:224:28: warning: passing argument 1 of 
‘mdopenfork’ from incompatible pointer type [-Wincompatible-pointer-types]
 224 |         return (mdopenfork(reln, forknum, EXTENSION_RETURN_NULL) != 
NULL);
     |                            ^~~~
     |                            |
     |                            SMgrRelation {aka SMgrRelationData *}
../src/backend/storage/smgr/md.c:167:43: note: expected ‘MdSMgrRelation’ {aka 
‘MdSMgrRelationData *’} but argument is of type ‘SMgrRelation’ {aka 
‘SMgrRelationData *’}
 167 | static MdfdVec *mdopenfork(MdSMgrRelation reln, ForkNumber forknum, int 
behavior);
     |                            ~~~~~~~~~~~~~~~^~~~
../src/backend/storage/smgr/md.c: In function ‘mdcreate’:
../src/backend/storage/smgr/md.c:287:40: warning: passing argument 1 of 
‘register_dirty_segment’ from incompatible pointer type 
[-Wincompatible-pointer-types]
 287 |                 register_dirty_segment(reln, forknum, mdfd);
     |                                        ^~~~
     |                                        |
     |                                        SMgrRelation {aka 
SMgrRelationData *}
../src/backend/storage/smgr/md.c:168:51: note: expected ‘MdSMgrRelation’ {aka 
‘MdSMgrRelationData *’} but argument is of type ‘SMgrRelation’ {aka 
‘SMgrRelationData *’}
 168 | static void register_dirty_segment(MdSMgrRelation reln, ForkNumber 
forknum,

Here is a diff to be applied to 0001 which fixes the warnings that get generated when compiling. I did see that one of the warnings gets fixed 0002 (the mdexists() one). I am assuming that change was just missed while rebasing the patchset or something. I did not see a fix for
mdcreate() in 0002 however.

--
Tristan Partin
Neon (https://neon.tech)
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
index f3e4768160..fdc9f62fdf 100644
--- a/src/backend/storage/smgr/md.c
+++ b/src/backend/storage/smgr/md.c
@@ -213,6 +213,8 @@ mdinit(void)
 bool
 mdexists(SMgrRelation reln, ForkNumber forknum)
 {
+	MdSMgrRelation mdreln = (MdSMgrRelation) reln;
+
 	/*
 	 * Close it first, to ensure that we notice if the fork has been unlinked
 	 * since we opened it.  As an optimization, we can skip that in recovery,
@@ -221,7 +223,7 @@ mdexists(SMgrRelation reln, ForkNumber forknum)
 	if (!InRecovery)
 		mdclose(reln, forknum);
 
-	return (mdopenfork(reln, forknum, EXTENSION_RETURN_NULL) != NULL);
+	return (mdopenfork(mdreln, forknum, EXTENSION_RETURN_NULL) != NULL);
 }
 
 /*
@@ -284,7 +286,7 @@ mdcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
 	mdfd->mdfd_segno = 0;
 
 	if (!SmgrIsTemp(reln))
-		register_dirty_segment(reln, forknum, mdfd);
+		register_dirty_segment(mdreln, forknum, mdfd);
 }
 
 /*

Reply via email to