aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-07-17 01:22:18 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-07-17 01:22:18 +0000
commitda15b2852e89c9b3348759febd864c436a78e3b9 (patch)
treedfb76505b705731a942647c2540635f02a350497 /src
parent62ca8db433cec4157248c6dcd9e03ff4760786c1 (diff)
downloadpostgresql-da15b2852e89c9b3348759febd864c436a78e3b9.tar.gz
postgresql-da15b2852e89c9b3348759febd864c436a78e3b9.zip
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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 97d9aed2407..c2cc9f2e0a1 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.218 2003/08/17 23:43:26 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.218.2.1 2007/07/17 01:22:18 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -1407,6 +1407,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 */
+ appendStringInfoString(str, "NULL");
+ break;
default:
elog(ERROR, "unrecognized node type: %d", (int) value->type);
break;
@@ -1435,8 +1439,9 @@ _outParamRef(StringInfo str, ParamRef *node)
static void
_outAConst(StringInfo str, A_Const *node)
{
- WRITE_NODE_TYPE("CONST ");
+ WRITE_NODE_TYPE("A_CONST");
+ appendStringInfo(str, " :val ");
_outValue(str, &(node->val));
WRITE_NODE_FIELD(typename);
}