mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 22:51:14 +02:00
Add routines to print AExpr, Ident, and AConst parsing structures.
This commit is contained in:
parent
2c833a728f
commit
12d5c30c8c
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.12 1997/12/18 12:53:51 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.13 1997/12/23 19:50:54 thomas Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||||
@ -1547,6 +1547,18 @@ _outStream(StringInfo str, Stream *node)
|
|||||||
appendStringInfo(str, buf);
|
appendStringInfo(str, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_outAExpr(StringInfo str, A_Expr *node)
|
||||||
|
{
|
||||||
|
char buf[500];
|
||||||
|
|
||||||
|
sprintf(buf, "EXPR %s", node->opname);
|
||||||
|
appendStringInfo(str, buf);
|
||||||
|
_outNode(str, node->lexpr);
|
||||||
|
_outNode(str, node->rexpr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_outValue(StringInfo str, Value *value)
|
_outValue(StringInfo str, Value *value)
|
||||||
{
|
{
|
||||||
@ -1572,6 +1584,27 @@ _outValue(StringInfo str, Value *value)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_outIdent(StringInfo str, Ident *node)
|
||||||
|
{
|
||||||
|
char buf[500];
|
||||||
|
|
||||||
|
sprintf(buf, "IDENT %s", node->name);
|
||||||
|
appendStringInfo(str, buf);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_outAConst(StringInfo str, A_Const *node)
|
||||||
|
{
|
||||||
|
char buf[500];
|
||||||
|
|
||||||
|
sprintf(buf, "CONST ");
|
||||||
|
appendStringInfo(str, buf);
|
||||||
|
_outValue(str, &(node->val));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _outNode -
|
* _outNode -
|
||||||
* converts a Node into ascii string and append it to 'str'
|
* converts a Node into ascii string and append it to 'str'
|
||||||
@ -1763,6 +1796,15 @@ _outNode(StringInfo str, void *obj)
|
|||||||
case T_Float:
|
case T_Float:
|
||||||
_outValue(str, obj);
|
_outValue(str, obj);
|
||||||
break;
|
break;
|
||||||
|
case T_A_Expr:
|
||||||
|
_outAExpr(str, obj);
|
||||||
|
break;
|
||||||
|
case T_Ident:
|
||||||
|
_outIdent(str, obj);
|
||||||
|
break;
|
||||||
|
case T_A_Const:
|
||||||
|
_outAConst(str, obj);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
elog(NOTICE, "_outNode: don't know how to print type %d",
|
elog(NOTICE, "_outNode: don't know how to print type %d",
|
||||||
nodeTag(obj));
|
nodeTag(obj));
|
||||||
|
Loading…
Reference in New Issue
Block a user