diff options
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r-- | src/backend/commands/functioncmds.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index c2bb4a2d9c8..a2a8f56e23c 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.67 2005/09/08 20:07:41 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.68 2005/09/24 22:54:36 tgl Exp $ * * DESCRIPTION * These routines take the parse tree and pick out the @@ -158,6 +158,8 @@ examine_parameter_list(List *parameters, Oid languageOid, ListCell *x; int i; + *requiredResultType = InvalidOid; /* default result */ + inTypes = (Oid *) palloc(parameterCount * sizeof(Oid)); allTypes = (Datum *) palloc(parameterCount * sizeof(Datum)); paramModes = (Datum *) palloc(parameterCount * sizeof(Datum)); @@ -243,7 +245,6 @@ examine_parameter_list(List *parameters, Oid languageOid, { *allParameterTypes = NULL; *parameterModes = NULL; - *requiredResultType = InvalidOid; } if (have_names) @@ -383,16 +384,22 @@ compute_attributes_sql_style(List *options, if (as_item) *as = (List *) as_item->arg; else + { ereport(ERROR, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), errmsg("no function body specified"))); + *as = NIL; /* keep compiler quiet */ + } if (language_item) *language = strVal(language_item->arg); else + { ereport(ERROR, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), errmsg("no language specified"))); + *language = NULL; /* keep compiler quiet */ + } /* process optional items */ if (volatility_item) |