Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita77dd53

Browse files
committed
Remove PortalGetQueryDesc()
After having gotten rid of PortalGetHeapMemory(), there seems littlereason to keep one Portal access macro around that offers no actualabstraction and isn't consistently used anyway.Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
1 parent0f7c49e commita77dd53

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

‎src/backend/commands/portalcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ PortalCleanup(Portal portal)
277277
* since other mechanisms will take care of releasing executor resources,
278278
* and we can't be sure that ExecutorEnd itself wouldn't fail.
279279
*/
280-
queryDesc=PortalGetQueryDesc(portal);
280+
queryDesc=portal->queryDesc;
281281
if (queryDesc)
282282
{
283283
/*
@@ -317,7 +317,7 @@ PortalCleanup(Portal portal)
317317
void
318318
PersistHoldablePortal(Portalportal)
319319
{
320-
QueryDesc*queryDesc=PortalGetQueryDesc(portal);
320+
QueryDesc*queryDesc=portal->queryDesc;
321321
PortalsaveActivePortal;
322322
ResourceOwnersaveResourceOwner;
323323
MemoryContextsavePortalContext;

‎src/backend/executor/execCurrent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ execCurrentOf(CurrentOfExpr *cexpr,
7575
(errcode(ERRCODE_INVALID_CURSOR_STATE),
7676
errmsg("cursor \"%s\" is not a SELECT query",
7777
cursor_name)));
78-
queryDesc=PortalGetQueryDesc(portal);
78+
queryDesc=portal->queryDesc;
7979
if (queryDesc==NULL||queryDesc->estate==NULL)
8080
ereport(ERROR,
8181
(errcode(ERRCODE_INVALID_CURSOR_STATE),

‎src/backend/tcop/pquery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ PortalRunSelect(Portal portal,
885885
* NB: queryDesc will be NULL if we are fetching from a held cursor or a
886886
* completed utility query; can't use it in that path.
887887
*/
888-
queryDesc=PortalGetQueryDesc(portal);
888+
queryDesc=portal->queryDesc;
889889

890890
/* Caller messed up if we have neither a ready query nor held data. */
891891
Assert(queryDesc||portal->holdStore);
@@ -1694,7 +1694,7 @@ DoPortalRewind(Portal portal)
16941694
}
16951695

16961696
/* Rewind executor, if active */
1697-
queryDesc=PortalGetQueryDesc(portal);
1697+
queryDesc=portal->queryDesc;
16981698
if (queryDesc)
16991699
{
17001700
PushActiveSnapshot(queryDesc->snapshot);

‎src/include/utils/portal.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ typedef struct PortalData
198198
*/
199199
#definePortalIsValid(p) PointerIsValid(p)
200200

201-
/*
202-
* Access macros for Portal ... use these in preference to field access.
203-
*/
204-
#definePortalGetQueryDesc(portal)((portal)->queryDesc)
205-
206201

207202
/* Prototypes for functions in utils/mmgr/portalmem.c */
208203
externvoidEnablePortalManager(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp