mirror of
https://github.com/postgres/postgres.git
synced 2025-08-09 17:03:00 +03:00
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.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* 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
|
* NOTES
|
||||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
* 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' */
|
/* internal representation already has leading 'b' */
|
||||||
appendStringInfo(str, " %s ", value->val.str);
|
appendStringInfo(str, " %s ", value->val.str);
|
||||||
break;
|
break;
|
||||||
|
case T_Null:
|
||||||
|
/* this is seen only within A_Const, not in transformed trees */
|
||||||
|
appendStringInfo(str, " NULL ");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
elog(WARNING, "_outValue: don't know how to print type %d ",
|
elog(WARNING, "_outValue: don't know how to print type %d ",
|
||||||
value->type);
|
value->type);
|
||||||
@@ -1367,7 +1371,7 @@ _outParamRef(StringInfo str, ParamRef *node)
|
|||||||
static void
|
static void
|
||||||
_outAConst(StringInfo str, A_Const *node)
|
_outAConst(StringInfo str, A_Const *node)
|
||||||
{
|
{
|
||||||
appendStringInfo(str, "CONST ");
|
appendStringInfo(str, " A_CONST :val ");
|
||||||
_outValue(str, &(node->val));
|
_outValue(str, &(node->val));
|
||||||
appendStringInfo(str, " :typename ");
|
appendStringInfo(str, " :typename ");
|
||||||
_outNode(str, node->typename);
|
_outNode(str, node->typename);
|
||||||
|
Reference in New Issue
Block a user