]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix type confusion in AddRelsyncInvalidationMessage
authorRobert Haas <rhaas@postgresql.org>
Thu, 11 Jun 2026 19:55:44 +0000 (15:55 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 11 Jun 2026 19:57:05 +0000 (15:57 -0400)
Since this is trying to add a SharedInvalRelSyncMsg rather than
a SharedInvalRelcacheMsg, it should use rs rather than rc.

This makes no difference as things stand, because the two structure
definitions are identical (except for the capitalization of "relid"),
but it's still a good idea to fix it.

Co-authored-by: Stolpovskikh Danil <d.stolpovskikh@ftdata.ru>
Co-authored-by: Robert Haas <rhaas@postgresql.org>
Discussion: http://postgr.es/m/bd6a5735b72b4afe99af49c3c62901d6@localhost.localdomain

src/backend/utils/cache/inval.c

index efc8b7b912239c58ce83c0fb83a4e80f4072e733..63dc36d4d91a4344c0ade4fb003a929b5d1bff26 100644 (file)
@@ -509,15 +509,15 @@ AddRelsyncInvalidationMessage(InvalidationMsgsGroup *group,
 
        /* Don't add a duplicate item. */
        ProcessMessageSubGroup(group, RelCacheMsgs,
-                                                  if (msg->rc.id == SHAREDINVALRELSYNC_ID &&
-                                                          (msg->rc.relId == relId ||
-                                                               msg->rc.relId == InvalidOid))
+                                                  if (msg->rs.id == SHAREDINVALRELSYNC_ID &&
+                                                          (msg->rs.relid == relId ||
+                                                               msg->rs.relid == InvalidOid))
                                                   return);
 
        /* OK, add the item */
-       msg.rc.id = SHAREDINVALRELSYNC_ID;
-       msg.rc.dbId = dbId;
-       msg.rc.relId = relId;
+       msg.rs.id = SHAREDINVALRELSYNC_ID;
+       msg.rs.dbId = dbId;
+       msg.rs.relid = relId;
        /* check AddCatcacheInvalidationMessage() for an explanation */
        VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));