Remove PortalGetQueryDesc()
After having gotten rid of PortalGetHeapMemory(), there seems little reason to keep one Portal access macro around that offers no actual abstraction and isn't consistently used anyway. Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
This commit is contained in:
parent
0f7c49e855
commit
a77dd53f30
@ -277,7 +277,7 @@ PortalCleanup(Portal portal)
|
|||||||
* since other mechanisms will take care of releasing executor resources,
|
* since other mechanisms will take care of releasing executor resources,
|
||||||
* and we can't be sure that ExecutorEnd itself wouldn't fail.
|
* and we can't be sure that ExecutorEnd itself wouldn't fail.
|
||||||
*/
|
*/
|
||||||
queryDesc = PortalGetQueryDesc(portal);
|
queryDesc = portal->queryDesc;
|
||||||
if (queryDesc)
|
if (queryDesc)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -317,7 +317,7 @@ PortalCleanup(Portal portal)
|
|||||||
void
|
void
|
||||||
PersistHoldablePortal(Portal portal)
|
PersistHoldablePortal(Portal portal)
|
||||||
{
|
{
|
||||||
QueryDesc *queryDesc = PortalGetQueryDesc(portal);
|
QueryDesc *queryDesc = portal->queryDesc;
|
||||||
Portal saveActivePortal;
|
Portal saveActivePortal;
|
||||||
ResourceOwner saveResourceOwner;
|
ResourceOwner saveResourceOwner;
|
||||||
MemoryContext savePortalContext;
|
MemoryContext savePortalContext;
|
||||||
|
@ -75,7 +75,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
|
|||||||
(errcode(ERRCODE_INVALID_CURSOR_STATE),
|
(errcode(ERRCODE_INVALID_CURSOR_STATE),
|
||||||
errmsg("cursor \"%s\" is not a SELECT query",
|
errmsg("cursor \"%s\" is not a SELECT query",
|
||||||
cursor_name)));
|
cursor_name)));
|
||||||
queryDesc = PortalGetQueryDesc(portal);
|
queryDesc = portal->queryDesc;
|
||||||
if (queryDesc == NULL || queryDesc->estate == NULL)
|
if (queryDesc == NULL || queryDesc->estate == NULL)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_CURSOR_STATE),
|
(errcode(ERRCODE_INVALID_CURSOR_STATE),
|
||||||
|
@ -885,7 +885,7 @@ PortalRunSelect(Portal portal,
|
|||||||
* NB: queryDesc will be NULL if we are fetching from a held cursor or a
|
* NB: queryDesc will be NULL if we are fetching from a held cursor or a
|
||||||
* completed utility query; can't use it in that path.
|
* completed utility query; can't use it in that path.
|
||||||
*/
|
*/
|
||||||
queryDesc = PortalGetQueryDesc(portal);
|
queryDesc = portal->queryDesc;
|
||||||
|
|
||||||
/* Caller messed up if we have neither a ready query nor held data. */
|
/* Caller messed up if we have neither a ready query nor held data. */
|
||||||
Assert(queryDesc || portal->holdStore);
|
Assert(queryDesc || portal->holdStore);
|
||||||
@ -1694,7 +1694,7 @@ DoPortalRewind(Portal portal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Rewind executor, if active */
|
/* Rewind executor, if active */
|
||||||
queryDesc = PortalGetQueryDesc(portal);
|
queryDesc = portal->queryDesc;
|
||||||
if (queryDesc)
|
if (queryDesc)
|
||||||
{
|
{
|
||||||
PushActiveSnapshot(queryDesc->snapshot);
|
PushActiveSnapshot(queryDesc->snapshot);
|
||||||
|
@ -198,11 +198,6 @@ typedef struct PortalData
|
|||||||
*/
|
*/
|
||||||
#define PortalIsValid(p) PointerIsValid(p)
|
#define PortalIsValid(p) PointerIsValid(p)
|
||||||
|
|
||||||
/*
|
|
||||||
* Access macros for Portal ... use these in preference to field access.
|
|
||||||
*/
|
|
||||||
#define PortalGetQueryDesc(portal) ((portal)->queryDesc)
|
|
||||||
|
|
||||||
|
|
||||||
/* Prototypes for functions in utils/mmgr/portalmem.c */
|
/* Prototypes for functions in utils/mmgr/portalmem.c */
|
||||||
extern void EnablePortalManager(void);
|
extern void EnablePortalManager(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user