Content-Length: 280125 | pFad | http://github.com/postgrespro/postgres_cluster/commit/e33884d4122b56fc0dbff3d8cedd8177334db838

26 Free pre-modification HeapTuple in ALTER TABLE ... TYPE ... · postgrespro/postgres_cluster@e33884d · GitHub
Skip to content

Commit e33884d

Browse files
committed
Free pre-modification HeapTuple in ALTER TABLE ... TYPE ...
This was an oversight in commit 3b174b1. Per offline gripe from Alvaro Herrera Backpatch to release 11.
1 parent 1db5667 commit e33884d

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
Datum valuesAtt[Natts_pg_attribute];
96499649
bool nullsAtt[Natts_pg_attribute];
96509650
bool replacesAtt[Natts_pg_attribute];
9651+
HeapTuple newTup;
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/e33884d4122b56fc0dbff3d8cedd8177334db838

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy