1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

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.
This commit is contained in:
Tom Lane
2002-02-14 15:24:10 +00:00
parent 1392042346
commit 3576820e78
4 changed files with 48 additions and 13 deletions

View File

@@ -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;