From: Tom Lane Date: Tue, 17 Jul 2007 01:22:03 +0000 (+0000) Subject: Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This has X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e87c76eb8a64ac2a942c6c73864ffea8f63f61cb;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 5ff9b93eae..6534ca35df 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -1632,6 +1632,10 @@ _outValue(StringInfo str, Value *value) /* internal representation already has leading 'b' */ appendStringInfoString(str, 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; @@ -1659,6 +1663,7 @@ _outAConst(StringInfo str, A_Const *node) { WRITE_NODE_TYPE("A_CONST"); + appendStringInfo(str, " :val "); _outValue(str, &(node->val)); WRITE_NODE_FIELD(typename); }