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

FOR UPDATE is in parser & rules.

This commit is contained in:
Vadim B. Mikheev
1999-01-21 16:08:55 +00:00
parent c8ae6afd13
commit 12be3e08f1
10 changed files with 763 additions and 609 deletions

View File

@@ -5,7 +5,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: outfuncs.c,v 1.59 1999/01/18 00:09:45 momjian Exp $
* $Id: outfuncs.c,v 1.60 1999/01/21 16:08:36 vadim Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -162,6 +162,7 @@ _outIndexElem(StringInfo str, IndexElem *node)
static void
_outQuery(StringInfo str, Query *node)
{
appendStringInfo(str, " QUERY :command %d ", node->commandType);
if (node->utilityStmt)
@@ -235,6 +236,10 @@ _outQuery(StringInfo str, Query *node)
appendStringInfo(str, " :limitCount ");
_outNode(str, node->limitCount);
appendStringInfo(str, " :rowMark ");
_outNode(str, node->rowMark);
}
static void
@@ -907,6 +912,12 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
node->skipAcl ? "true" : "false");
}
static void
_outRowMark(StringInfo str, RowMark *node)
{
appendStringInfo(str, " ROWMARK :rti %u :info %u", node->rti, node->info);
}
/*
* Path is a subclass of Node.
*/
@@ -1528,6 +1539,9 @@ _outNode(StringInfo str, void *obj)
case T_RangeTblEntry:
_outRangeTblEntry(str, obj);
break;
case T_RowMark:
_outRowMark(str, obj);
break;
case T_Path:
_outPath(str, obj);
break;

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.41 1999/01/18 00:09:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.42 1999/01/21 16:08:37 vadim Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -174,6 +174,9 @@ _readQuery()
token = lsptok(NULL, &length); /* skip :limitCount */
local_node->limitCount = nodeRead(true);
token = lsptok(NULL, &length); /* skip :rowMark */
local_node->rowMark = nodeRead(true);
return local_node;
}
@@ -1427,6 +1430,24 @@ _readRangeTblEntry()
return local_node;
}
static RowMark *
_readRowMark()
{
RowMark *local_node = makeNode(RowMark);
char *token;
int length;
token = lsptok(NULL, &length); /* eat :rti */
token = lsptok(NULL, &length); /* get :rti */
local_node->rti = strtoul(token, NULL, 10);
token = lsptok(NULL, &length); /* eat :info */
token = lsptok(NULL, &length); /* get :info */
local_node->info = strtoul(token, NULL, 10);
return local_node;
}
/* ----------------
* _readPath
*
@@ -2090,6 +2111,8 @@ parsePlanString(void)
return_value = _readCaseExpr();
else if (!strncmp(token, "WHEN", length))
return_value = _readCaseWhen();
else if (!strncmp(token, "ROWMARK", length))
return_value = _readRowMark();
else
elog(ERROR, "badly formatted planstring \"%.10s\"...\n", token);