Skip to content

Commit 099e711

Browse files
committed
Undo unintentional ABI break in struct ResultRelInfo.
Commits aac2c9b et al. added a bool field to struct ResultRelInfo. That's no problem in the master branch, but in released branches care must be taken when modifying publicly-visible structs to avoid an ABI break for extensions. Frequently we solve that by adding the new field at the end of the struct, and that's what was done here. But ResultRelInfo has stricter constraints than just about any other node type in Postgres. Some executor APIs require extensions to index into arrays of ResultRelInfo, which means that any change whatever in sizeof(ResultRelInfo) causes a fatal ABI break. Fortunately, this is easy to fix, because the new field can be squeezed into available padding space instead --- indeed, that's where it was put in master, so this fix also removes a cross-branch coding variation. Per report from Pavan Deolasee. Patch v14-v17 only; earlier versions did not gain the extra field, nor is there any problem in master. Discussion: https://postgr.es/m/CABOikdNmVBC1LL6pY26dyxAS2f+gLZvTsNt=2XbcyG7WxXVBBQ@mail.gmail.com
1 parent be062bf commit 099e711

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/include/nodes/execnodes.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@ typedef struct ResultRelInfo
434434
/* Have the projection and the slots above been initialized? */
435435
bool ri_projectNewInfoValid;
436436

437+
/* updates do LockTuple() before oldtup read; see README.tuplock */
438+
bool ri_needLockTagTuple;
439+
437440
/* triggers to be fired, if any */
438441
TriggerDesc *ri_TrigDesc;
439442

@@ -524,9 +527,6 @@ typedef struct ResultRelInfo
524527

525528
/* for use by copyfrom.c when performing multi-inserts */
526529
struct CopyMultiInsertBuffer *ri_CopyMultiInsertBuffer;
527-
528-
/* updates do LockTuple() before oldtup read; see README.tuplock */
529-
bool ri_needLockTagTuple;
530530
} ResultRelInfo;
531531

532532
/*

0 commit comments

Comments
 (0)