mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Fix array coercion expressions to ensure that the correct volatility is
seen by code inspecting the expression. The best way to do this seems to be to drop the original representation as a function invocation, and instead make a special expression node type that represents applying the element-type coercion function to each array element. In this way the element function is exposed and will be checked for volatility. Per report from Guillaume Smet.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.204 2007/03/17 00:11:04 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.205 2007/03/27 23:21:09 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Path and Plan nodes do not have any readfuncs support, because we
|
||||
@ -584,6 +584,24 @@ _readRelabelType(void)
|
||||
READ_DONE();
|
||||
}
|
||||
|
||||
/*
|
||||
* _readArrayCoerceExpr
|
||||
*/
|
||||
static ArrayCoerceExpr *
|
||||
_readArrayCoerceExpr(void)
|
||||
{
|
||||
READ_LOCALS(ArrayCoerceExpr);
|
||||
|
||||
READ_NODE_FIELD(arg);
|
||||
READ_OID_FIELD(elemfuncid);
|
||||
READ_OID_FIELD(resulttype);
|
||||
READ_INT_FIELD(resulttypmod);
|
||||
READ_BOOL_FIELD(isExplicit);
|
||||
READ_ENUM_FIELD(coerceformat, CoercionForm);
|
||||
|
||||
READ_DONE();
|
||||
}
|
||||
|
||||
/*
|
||||
* _readConvertRowtypeExpr
|
||||
*/
|
||||
@ -1024,6 +1042,8 @@ parseNodeString(void)
|
||||
return_value = _readFieldStore();
|
||||
else if (MATCH("RELABELTYPE", 11))
|
||||
return_value = _readRelabelType();
|
||||
else if (MATCH("ARRAYCOERCEEXPR", 15))
|
||||
return_value = _readArrayCoerceExpr();
|
||||
else if (MATCH("CONVERTROWTYPEEXPR", 18))
|
||||
return_value = _readConvertRowtypeExpr();
|
||||
else if (MATCH("CASE", 4))
|
||||
|
Reference in New Issue
Block a user