Skip to content

Commit

Permalink
Revert "HAWQ-1417. Fixed crash when ANALYZE after COPY because of inv…
Browse files Browse the repository at this point in the history
…alid resource owner"

This reverts commit db55684.
  • Loading branch information
liming01 committed Apr 7, 2017
1 parent db55684 commit 1d914de
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/backend/commands/analyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ void analyzeStmt(VacuumStmt *stmt, List *relids, int preferred_seg_num)
ListCell *le1 = NULL;
int successCount = 0, failCount = 0;
StringInfoData failNames;
ResourceOwner owner, oldOwner;

/**
* Ensure that an ANALYZE is requested.
Expand Down Expand Up @@ -477,13 +476,6 @@ void analyzeStmt(VacuumStmt *stmt, List *relids, int preferred_seg_num)
MemoryContextSwitchTo(analyzeStatementContext);
}

/**
* Create a resource owner to keep track of our resources even not in trasaction block
*/
owner = ResourceOwnerCreate(CurrentResourceOwner, "analyzeStmt");
oldOwner = CurrentResourceOwner;
CurrentResourceOwner = owner;

/**
* we use preferred_seg_num as default and
* compute target_seg_num based on data size and distributed type
Expand Down Expand Up @@ -816,12 +808,6 @@ void analyzeStmt(VacuumStmt *stmt, List *relids, int preferred_seg_num)
elog(failCount > 0 ? INFO : elevel, "ANALYZE completed. Success: %d, Failure: %d %s", successCount, failCount, failNames.data);
pfree(failNames.data);

ResourceOwnerRelease(owner,
RESOURCE_RELEASE_BEFORE_LOCKS,
false, true);
ResourceOwnerDelete(owner);
CurrentResourceOwner = oldOwner;

Assert(analyzeStatementContext == CurrentMemoryContext);
MemoryContextSwitchTo(callerContext);
MemoryContextDelete(analyzeStatementContext);
Expand Down

0 comments on commit 1d914de

Please sign in to comment.