diff options
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
-rw-r--r-- | src/backend/optimizer/util/clauses.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index aac66abfba5..10a8e80140b 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.232 2007/02/01 19:10:26 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.233 2007/02/02 00:02:55 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -2751,7 +2751,6 @@ inline_function(Oid funcid, Oid result_type, List *args, eval_const_expressions_context *context) { Form_pg_proc funcform = (Form_pg_proc) GETSTRUCT(func_tuple); - bool polymorphic = false; Oid *argtypes; char *src; Datum tmp; @@ -2814,15 +2813,10 @@ inline_function(Oid funcid, Oid result_type, List *args, if (argtypes[i] == ANYARRAYOID || argtypes[i] == ANYELEMENTOID) { - polymorphic = true; argtypes[i] = exprType((Node *) list_nth(args, i)); } } - if (funcform->prorettype == ANYARRAYOID || - funcform->prorettype == ANYELEMENTOID) - polymorphic = true; - /* Fetch and parse the function body */ tmp = SysCacheGetAttr(PROCOID, func_tuple, @@ -2874,15 +2868,13 @@ inline_function(Oid funcid, Oid result_type, List *args, newexpr = (Node *) ((TargetEntry *) linitial(querytree->targetList))->expr; /* - * If the function has any arguments declared as polymorphic types, then - * it wasn't type-checked at definition time; must do so now. (This will + * Make sure the function (still) returns what it's declared to. This will * raise an error if wrong, but that's okay since the function would fail * at runtime anyway. Note we do not try this until we have verified that * no rewriting was needed; that's probably not important, but let's be - * careful.) + * careful. */ - if (polymorphic) - (void) check_sql_fn_retval(funcid, result_type, querytree_list, NULL); + (void) check_sql_fn_retval(funcid, result_type, querytree_list, NULL); /* * Additional validity checks on the expression. It mustn't return a set, |