git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbe0a81)
Fix use-after-ReleaseSysCache problem in ATExecAlterColumnType.
2021年3月19日 21:17:48 +0000 (17:17 -0400)
2021年3月19日 21:17:48 +0000 (17:17 -0400)
Introduced by commit bbe0a81db69bd10bd166907c3701492a29aca294.

Per buildfarm member prion.


diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index ab89935ba73b73d0ca2985f2898386fe9085809a..9b2800bf5e2f1cbf55c1b085961640ff2a96fc09 100644 (file)
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -11953,8 +11953,6 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
attTup->attalign = tform->typalign;
attTup->attstorage = tform->typstorage;
- ReleaseSysCache(typeTuple);
-
/* Setup attribute compression */
if (rel->rd_rel->relkind == RELKIND_RELATION ||
rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
@@ -11972,6 +11970,8 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
else
attTup->attcompression = InvalidCompressionMethod;
+ ReleaseSysCache(typeTuple);
+
CatalogTupleUpdate(attrelation, &heapTup->t_self, heapTup);
table_close(attrelation, RowExclusiveLock);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /