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

Commit89d52b9

Browse files
committed
Free pre-modification HeapTuple in ALTER TABLE ... TYPE ...
This was an oversight in commit3b174b1.Per offline gripe from Alvaro HerreraBackpatch to release 11.
1 parent05eb923 commit89d52b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9747,6 +9747,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
97479747
DatumvaluesAtt[Natts_pg_attribute];
97489748
boolnullsAtt[Natts_pg_attribute];
97499749
boolreplacesAtt[Natts_pg_attribute];
9750+
HeapTuplenewTup;
97509751

97519752
MemSet(valuesAtt,0,sizeof(valuesAtt));
97529753
MemSet(nullsAtt, false,sizeof(nullsAtt));
@@ -9772,8 +9773,10 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
97729773
replacesAtt[Anum_pg_attribute_attmissingval-1]= true;
97739774
nullsAtt[Anum_pg_attribute_attmissingval-1]= false;
97749775

9775-
heapTup=heap_modify_tuple(heapTup,RelationGetDescr(attrelation),
9776-
valuesAtt,nullsAtt,replacesAtt);
9776+
newTup=heap_modify_tuple(heapTup,RelationGetDescr(attrelation),
9777+
valuesAtt,nullsAtt,replacesAtt);
9778+
heap_freetuple(heapTup);
9779+
heapTup=newTup;
97779780
attTup= (Form_pg_attribute)GETSTRUCT(heapTup);
97789781
}
97799782
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp