diff options
| author | Tom Lane | 2002-02-14 15:24:10 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-02-14 15:24:10 +0000 |
| commit | 3576820e7852ab20d552fe5aa7abb2847db62f6f (patch) | |
| tree | 207f056de4c5e95b5000b119c4d6e0d8b0380ffa /src/backend/utils/mmgr | |
| parent | 13920423466a345e832ed844e9513ad2eed43731 (diff) | |
Ensure that a cursor is scanned under the same scanCommandId it was
originally created with, so that the set of visible tuples does not
change as a result of other activity. This essentially makes PG cursors
INSENSITIVE per the SQL92 definition. See bug report of 13-Feb-02.
Diffstat (limited to 'src/backend/utils/mmgr')
| -rw-r--r-- | src/backend/utils/mmgr/portalmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index 25171ea7bee..76827529224 100644 --- a/src/backend/utils/mmgr/portalmem.c +++ b/src/backend/utils/mmgr/portalmem.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.44 2001/10/25 05:49:51 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.45 2002/02/14 15:24:09 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -168,6 +168,7 @@ PortalSetQuery(Portal portal, portal->queryDesc = queryDesc; portal->attinfo = attinfo; + portal->commandId = GetScanCommandId(); portal->state = state; portal->atStart = true; /* Allow fetch forward only */ portal->atEnd = false; @@ -213,6 +214,7 @@ CreatePortal(char *name) /* initialize portal query */ portal->queryDesc = NULL; portal->attinfo = NULL; + portal->commandId = 0; portal->state = NULL; portal->atStart = true; /* disallow fetches until query is set */ portal->atEnd = true; |
