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

Commite33884d

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 parent1db5667 commite33884d

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
@@ -9648,6 +9648,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
96489648
DatumvaluesAtt[Natts_pg_attribute];
96499649
boolnullsAtt[Natts_pg_attribute];
96509650
boolreplacesAtt[Natts_pg_attribute];
9651+
HeapTuplenewTup;
96519652

96529653
MemSet(valuesAtt,0,sizeof(valuesAtt));
96539654
MemSet(nullsAtt, false,sizeof(nullsAtt));
@@ -9673,8 +9674,10 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
96739674
replacesAtt[Anum_pg_attribute_attmissingval-1]= true;
96749675
nullsAtt[Anum_pg_attribute_attmissingval-1]= false;
96759676

9676-
heapTup=heap_modify_tuple(heapTup,RelationGetDescr(attrelation),
9677-
valuesAtt,nullsAtt,replacesAtt);
9677+
newTup=heap_modify_tuple(heapTup,RelationGetDescr(attrelation),
9678+
valuesAtt,nullsAtt,replacesAtt);
9679+
heap_freetuple(heapTup);
9680+
heapTup=newTup;
96789681
attTup= (Form_pg_attribute)GETSTRUCT(heapTup);
96799682
}
96809683
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp