*** src/backend/access/transam/xact.c.orig Thu Oct 8 14:29:15 1998 --- src/backend/access/transam/xact.c Thu May 13 18:53:05 1999 *************** *** 767,776 **** static void AtAbort_Memory() { /* ---------------- ! * after doing an abort transaction, make certain the ! * system uses the top memory context rather then the ! * portal memory context (until the next transaction). * ---------------- */ MemoryContextSwitchTo(TopMemoryContext); --- 767,791 ---- static void AtAbort_Memory() { + Portal portal; + MemoryContext portalContext; + /* ---------------- ! * Release memory in the blank portal. ! * Since EndPortalAllocMode implicitly works on the current context, ! * first make real sure that the blank portal is the selected context. ! * (This is ESSENTIAL in case we aborted from someplace where it wasn't.) ! * ---------------- ! */ ! portal = GetPortalByName(NULL); ! portalContext = (MemoryContext) PortalGetHeapMemory(portal); ! MemoryContextSwitchTo(portalContext); ! EndPortalAllocMode(); ! ! /* ---------------- ! * Now that we're "out" of a transaction, have the ! * system allocate things in the top memory context instead ! * of the blank portal memory context. * ---------------- */ MemoryContextSwitchTo(TopMemoryContext);