Short circuit in multi_ProcessUtility on ABORT/COMMIT

pull/1171/head
Marco Slot 2017-01-24 22:51:34 +01:00
parent 2748660b1c
commit 85c1a87999
1 changed files with 14 additions and 0 deletions

View File

@ -174,6 +174,20 @@ multi_ProcessUtility(Node *parsetree,
Oid savedUserId = InvalidOid; Oid savedUserId = InvalidOid;
int savedSecurityContext = 0; int savedSecurityContext = 0;
if (IsA(parsetree, TransactionStmt))
{
/*
* Transaction statements (e.g. ABORT, COMMIT) can be run in aborted
* transactions in which case a lot of checks cannot be done safely in
* that state. Since we never need to intercept transaction statements,
* skip our checks and immediately fall into standard_ProcessUtility.
*/
standard_ProcessUtility(parsetree, queryString, context,
params, dest, completionTag);
return;
}
/* /*
* TRANSMIT used to be separate command, but to avoid patching the grammar * TRANSMIT used to be separate command, but to avoid patching the grammar
* it's no overlaid onto COPY, but with FORMAT = 'transmit' instead of the * it's no overlaid onto COPY, but with FORMAT = 'transmit' instead of the