mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Add a paramtypmod field to Param nodes. This is dead weight for Params
representing externally-supplied values, since the APIs that carry such values only specify type not typmod. However, for PARAM_SUBLINK Params it is handy to carry the typmod of the sublink's output column. This is a much cleaner solution for the recently reported 'could not find pathkey item to sort' and 'failed to find unique expression in subplan tlist' bugs than my original 8.2-compatible patch. Besides, someday we might want to support typmods for external parameters ...
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.353 2006/11/05 22:42:08 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.354 2006/12/10 22:13:26 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -745,6 +745,7 @@ _copyParam(Param *from)
|
||||
COPY_SCALAR_FIELD(paramkind);
|
||||
COPY_SCALAR_FIELD(paramid);
|
||||
COPY_SCALAR_FIELD(paramtype);
|
||||
COPY_SCALAR_FIELD(paramtypmod);
|
||||
|
||||
return newnode;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.287 2006/11/05 22:42:08 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.288 2006/12/10 22:13:26 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -147,6 +147,7 @@ _equalParam(Param *a, Param *b)
|
||||
COMPARE_SCALAR_FIELD(paramkind);
|
||||
COMPARE_SCALAR_FIELD(paramid);
|
||||
COMPARE_SCALAR_FIELD(paramtype);
|
||||
COMPARE_SCALAR_FIELD(paramtypmod);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.285 2006/09/19 22:49:52 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.286 2006/12/10 22:13:26 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every node type that can appear in stored rules' parsetrees *must*
|
||||
@@ -634,6 +634,7 @@ _outParam(StringInfo str, Param *node)
|
||||
WRITE_ENUM_FIELD(paramkind, ParamKind);
|
||||
WRITE_INT_FIELD(paramid);
|
||||
WRITE_OID_FIELD(paramtype);
|
||||
WRITE_INT_FIELD(paramtypmod);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.195 2006/08/12 02:52:04 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.196 2006/12/10 22:13:26 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Path and Plan nodes do not have any readfuncs support, because we
|
||||
@@ -337,6 +337,7 @@ _readParam(void)
|
||||
READ_ENUM_FIELD(paramkind, ParamKind);
|
||||
READ_INT_FIELD(paramid);
|
||||
READ_OID_FIELD(paramtype);
|
||||
READ_INT_FIELD(paramtypmod);
|
||||
|
||||
READ_DONE();
|
||||
}
|
||||
|
Reference in New Issue
Block a user