pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Minor code review for tuple slot rewrite.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Minor code review for tuple slot rewrite.
@ 2019-11-06 17:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-11-06 17:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Minor code review for tuple slot rewrite.

Avoid creating transiently-inconsistent slot states where possible,
by not setting TTS_FLAG_SHOULDFREE until after the slot actually has
a free'able tuple pointer, and by making sure that we reset tts_nvalid
and related derived state before we replace the tuple contents.  This
would only matter if something were to examine the slot after we'd
suffered some kind of error (e.g. out of memory) while manipulating
the slot.  We typically don't do that, so these changes might just be
cosmetic --- but even if so, it seems like good future-proofing.

Also remove some redundant Asserts, and add a couple for consistency.

Back-patch to v12 where all this code was rewritten.

Discussion: https://postgr.es/m/16095-c3ff2e5283b8dba5@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/22e44e8dbcfe4b9f3c4189f07a2361c951d72514

Modified Files
--------------
src/backend/executor/execTuples.c | 81 +++++++++++++++++++++------------------
src/include/executor/tuptable.h   |  5 +--
2 files changed, 45 insertions(+), 41 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Minor code review for tuple slot rewrite.
@ 2019-11-06 17:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-11-06 17:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Minor code review for tuple slot rewrite.

Avoid creating transiently-inconsistent slot states where possible,
by not setting TTS_FLAG_SHOULDFREE until after the slot actually has
a free'able tuple pointer, and by making sure that we reset tts_nvalid
and related derived state before we replace the tuple contents.  This
would only matter if something were to examine the slot after we'd
suffered some kind of error (e.g. out of memory) while manipulating
the slot.  We typically don't do that, so these changes might just be
cosmetic --- but even if so, it seems like good future-proofing.

Also remove some redundant Asserts, and add a couple for consistency.

Back-patch to v12 where all this code was rewritten.

Discussion: https://postgr.es/m/16095-c3ff2e5283b8dba5@postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9dbc6d25a97d11475fde36c4f71359371bbe240b

Modified Files
--------------
src/backend/executor/execTuples.c | 81 +++++++++++++++++++++------------------
src/include/executor/tuptable.h   |  5 +--
2 files changed, 45 insertions(+), 41 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-11-06 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 17:00 pgsql: Minor code review for tuple slot rewrite. Tom Lane <tgl@sss.pgh.pa.us>
2019-11-06 17:00 pgsql: Minor code review for tuple slot rewrite. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox