8000 Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. T… · filiprem/postgres@f1dda4c · GitHub
[go: up one dir, main page]

Skip to content

Commit f1dda4c

Browse files
committed
Fix outfuncs.c to dump A_Const nodes representing NULLs correctly. This h 8000 as
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.
1 parent a776eae commit f1dda4c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.176 2002/10/14 22:14:34 tgl Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.176.2.1 2007/07/17 01:22:25 tgl Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -1320,6 +1320,10 @@ _outValue(StringInfo str, Value *value)
13201320
/* internal representation already has leading 'b' */
13211321
appendStringInfo(str, " %s ", value->val.str);
13221322
break;
1323+
case T_Null:
1324+
/* this is seen only within A_Const, not in transformed trees */
1325+
appendStringInfo(str, " NULL ");
1326+
break;
13231327
default:
13241328
elog(WARNING, "_outValue: don't know how to print type %d ",
13251329
value->type);
@@ -1367,7 +1371,7 @@ _outParamRef(StringInfo str, ParamRef *node)
13671371
static void
13681372
_outAConst(StringInfo str, A_Const *node)
13691373
{
1370-
appendStringInfo(str, "CONST ");
1374+
appendStringInfo(str, " A_CONST :val ");
13711375
_outValue(str, &(node->val));
13721376
appendStringInfo(str, " :typename ");
13731377
_outNode(str, node->typename);

0 commit comments

Comments
 (0)
0