|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.34 1998/04/27 02:58:05 momjian Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.35 1998/05/09 23:46:35 thomas Exp $ |
11 | 11 | *
|
12 | 12 | * NOTES
|
13 | 13 | * Every (plan) node in POSTGRES has an associated "out" routine which
|
|
45 | 45 | #include "catalog/pg_type.h"
|
46 | 46 | #include "lib/stringinfo.h"
|
47 | 47 |
|
| 48 | +#ifdef PARSEDEBUG |
| 49 | +#include "../parse.h" |
| 50 | +#endif |
| 51 | + |
48 | 52 | static void _outDatum(StringInfo str, Datum value, Oid type);
|
49 | 53 | static void _outNode(StringInfo str, void *obj);
|
50 | 54 |
|
@@ -107,6 +111,26 @@ _outIndexStmt(StringInfo str, IndexStmt *node)
|
107 | 111 | appendStringInfo(str, (node->unique ? "true" : "false"));
|
108 | 112 | }
|
109 | 113 |
|
| 114 | +#ifdef PARSEDEBUG |
| 115 | +static void |
| 116 | +_outSelectStmt(StringInfo str, SelectStmt *node) |
| 117 | +{ |
| 118 | + appendStringInfo(str, "SELECT"); |
| 119 | + |
| 120 | + appendStringInfo(str, " :where "); |
| 121 | + _outNode(str, node->whereClause); |
| 122 | +} |
| 123 | + |
| 124 | +static void |
| 125 | +_outFuncCall(StringInfo str, FuncCall *node) |
| 126 | +{ |
| 127 | + appendStringInfo(str, "FUNCTION "); |
| 128 | + appendStringInfo(str, node->funcname); |
| 129 | + appendStringInfo(str, " :args "); |
| 130 | + _outNode(str, node->args); |
| 131 | +} |
| 132 | +#endif |
| 133 | + |
110 | 134 | static void
|
111 | 135 | _outColumnDef(StringInfo str, ColumnDef *node)
|
112 | 136 | {
|
@@ -1534,7 +1558,31 @@ static void
|
1534 | 1558 | _outAExpr(StringInfo str, A_Expr *node)
|
1535 | 1559 | {
|
1536 | 1560 | appendStringInfo(str, "EXPR ");
|
1537 |
| - appendStringInfo(str, node->opname); |
| 1561 | +#ifdef PARSEDEBUG |
| 1562 | + switch (node->oper) |
| 1563 | + { |
| 1564 | + case AND: |
| 1565 | + appendStringInfo(str, "AND"); |
| 1566 | + break; |
| 1567 | + case OR: |
| 1568 | + appendStringInfo(str, "OR"); |
| 1569 | + break; |
| 1570 | + case NOT: |
| 1571 | + appendStringInfo(str, "NOT"); |
| 1572 | + break; |
| 1573 | + case ISNULL: |
| 1574 | + appendStringInfo(str, "ISNULL"); |
| 1575 | + break; |
| 1576 | + case NOTNULL: |
| 1577 | + appendStringInfo(str, "NOTNULL"); |
| 1578 | + break; |
| 1579 | + default: |
| 1580 | +#endif |
| 1581 | + appendStringInfo(str, node->opname); |
| 1582 | +#ifdef PARSEDEBUG |
| 1583 | + break; |
| 1584 | + } |
| 1585 | +#endif |
1538 | 1586 | _outNode(str, node->lexpr);
|
1539 | 1587 | _outNode(str, node->rexpr);
|
1540 | 1588 | return;
|
@@ -1634,6 +1682,17 @@ _outNode(StringInfo str, void *obj)
|
1634 | 1682 | _outIndexElem(str, obj);
|
1635 | 1683 | break;
|
1636 | 1684 |
|
| 1685 | +#ifdef PARSEDEBUG |
| 1686 | + case T_VariableSetStmt: |
| 1687 | + break; |
| 1688 | + case T_SelectStmt: |
| 1689 | + _outSelectStmt(str, obj); |
| 1690 | + break; |
| 1691 | + case T_FuncCall: |
| 1692 | + _outFuncCall(str, obj); |
| 1693 | + break; |
| 1694 | +#endif |
| 1695 | + |
1637 | 1696 | case T_Query:
|
1638 | 1697 | _outQuery(str, obj);
|
1639 | 1698 | break;
|
|
0 commit comments