From: Tom Lane Date: Tue, 17 Jul 2007 01:22:11 +0000 (+0000) Subject: Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This has X-Git-Tag: REL8_0_14~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba56b484ea7b7977b2c3fdb11d233ba549c6bdd6;p=thirdparty%2Fpostgresql.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 bb2b2c35f90..246a7210d86 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.245 2004/12/31 21:59:55 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.245.4.1 2007/07/17 01:22:11 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -1476,6 +1476,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; @@ -1503,6 +1507,7 @@ _outAConst(StringInfo str, A_Const *node) { WRITE_NODE_TYPE("A_CONST"); + appendStringInfo(str, " :val "); _outValue(str, &(node->val)); WRITE_NODE_FIELD(typename); }