index 53f3d625d039c845e99124982ab961a955646b30..b1282a14626679be7c6832b2faf2689452ca1006 100644 (file)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_param.c,v 2.2 2010年01月02日 16:57:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_param.c,v 2.3 2010年01月13日 01:17:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -100,8 +100,9 @@ fixed_paramref_hook(ParseState *pstate, ParamRef *pref)
int paramno = pref->number;
Param *param;
- /* Check parameter number is in range */
- if (paramno <= 0 || paramno > parstate->numParams)
+ /* Check parameter number is valid */
+ if (paramno <= 0 || paramno > parstate->numParams ||
+ !OidIsValid(parstate->paramTypes[paramno - 1]))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_PARAMETER),
errmsg("there is no parameter $%d", paramno),