Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite63ce9e

Browse files
Ensure that slots are zeroed before use
The previous coding relied on the memory for the slots being zeroedelsewhere, which while it was true in this case is not an contractwhich is guaranteed to hold. Explicitly clear the tts_isnull arrayto ensure that the slots are filled from a known state.Backpatch to v14 where the catalog multi-inserts were introduced.Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/CAJ7c6TP0AowkUgNL6zcAK-s5HYsVHVBRWfu69FRubPpfwZGM9A@mail.gmail.comBackpatch-through: 14
1 parent8af09da commite63ce9e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎src/backend/catalog/heap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,9 @@ InsertPgAttributeTuples(Relation pg_attribute_rel,
764764

765765
ExecClearTuple(slot[slotCount]);
766766

767+
memset(slot[slotCount]->tts_isnull, false,
768+
slot[slotCount]->tts_tupleDescriptor->natts*sizeof(bool));
769+
767770
if (new_rel_oid!=InvalidOid)
768771
slot[slotCount]->tts_values[Anum_pg_attribute_attrelid-1]=ObjectIdGetDatum(new_rel_oid);
769772
else

‎src/backend/catalog/pg_shdepend.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,9 @@ copyTemplateDependencies(Oid templateDbId, Oid newDbId)
903903

904904
ExecClearTuple(slot[slot_stored_count]);
905905

906+
memset(slot[slot_stored_count]->tts_isnull, false,
907+
slot[slot_stored_count]->tts_tupleDescriptor->natts*sizeof(bool));
908+
906909
shdep= (Form_pg_shdepend)GETSTRUCT(tup);
907910

908911
slot[slot_stored_count]->tts_values[Anum_pg_shdepend_dbid-1]=ObjectIdGetDatum(newDbId);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp