summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-07-17 01:22:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-07-17 01:22:25 +0000
commitf1dda4c54e1b1d52e9975f9de8feac951ee6d45b (patch)
tree23a4a0ceb52e070d1350307fff3e99bf75820975 /src
parenta776eaea3c661314e8fb14d69d627eebf11f3fef (diff)
downloadpostgresql-f1dda4c54e1b1d52e9975f9de8feac951ee6d45b.tar.gz
Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This has
been broken since forever, but was not noticed because people seldom look at raw parse trees. AFAIK, no impact on users except that debug_print_parse might fail; but patch it all the way back anyway. Per report from Jeff Ross.
Diffstat (limited to 'src')
-rw-r--r--src/backend/nodes/outfuncs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index e1a34118a6..da884a82f7 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.176 2002/10/14 22:14:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.176.2.1 2007/07/17 01:22:25 tgl Exp $
*
* NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -1320,6 +1320,10 @@ _outValue(StringInfo str, Value *value)
/* internal representation already has leading 'b' */
appendStringInfo(str, " %s ", value->val.str);
break;
+ case T_Null:
+ /* this is seen only within A_Const, not in transformed trees */
+ appendStringInfo(str, " NULL ");
+ break;
default:
elog(WARNING, "_outValue: don't know how to print type %d ",
value->type);
@@ -1367,7 +1371,7 @@ _outParamRef(StringInfo str, ParamRef *node)
static void
_outAConst(StringInfo str, A_Const *node)
{
- appendStringInfo(str, "CONST ");
+ appendStringInfo(str, " A_CONST :val ");
_outValue(str, &(node->val));
appendStringInfo(str, " :typename ");
_outNode(str, node->typename);