Created
May 6, 2016 07:03
-
-
Save danielgustafsson/955c64ed84f5ab6fb5698664097c6b0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/backend/access/appendonly/aosegfiles.c b/src/backend/access/appendonly/aosegfiles.c | |
index b03661b..d67b069 100644 | |
--- a/src/backend/access/appendonly/aosegfiles.c | |
+++ b/src/backend/access/appendonly/aosegfiles.c | |
@@ -1985,7 +1985,7 @@ aorow_compression_ratio_internal(Relation parentrel) | |
int ret; | |
float8 compress_ratio = -1; /* the default, meaning "not available" */ | |
- MemoryContext oldcontext = CurrentMemoryContext; | |
+ MemoryContext oldcontext; | |
Oid segrelid = InvalidOid; | |
GetAppendOnlyEntryAuxOids(RelationGetRelid(parentrel), SnapshotNow, | |
@@ -2046,7 +2046,7 @@ aorow_compression_ratio_internal(Relation parentrel) | |
val_eof_uncomp = SPI_getvalue(tuple, tupdesc, 2); | |
/* use our own context so that SPI won't free our stuff later */ | |
- cxt_save = MemoryContextSwitchTo(oldcontext); | |
+ oldcontext = MemoryContextSwitchTo(cxt_save); | |
/* | |
* Calculate the compression ratio. but do it only if the uncomp | |
@@ -2079,8 +2079,7 @@ aorow_compression_ratio_internal(Relation parentrel) | |
} | |
} | |
- MemoryContextSwitchTo(cxt_save); | |
- | |
+ MemoryContextSwitchTo(oldcontext); | |
} | |
connected = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment