diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-07 18:38:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-07 18:38:51 +0000 |
commit | a8487e15ed91c10bdbba1096c6e941c6ecb8b11a (patch) | |
tree | 03bad7b5e08fc0e7762b273685acc3902139dc9b /src/backend/optimizer/util/clauses.c | |
parent | 6d46ea25f2131b34c1983a171e45041ba93390e0 (diff) | |
download | postgresql-a8487e15ed91c10bdbba1096c6e941c6ecb8b11a.tar.gz postgresql-a8487e15ed91c10bdbba1096c6e941c6ecb8b11a.zip |
Fix problems with SQL functions returning rowtypes that have dropped
columns. The returned tuple needs to have appropriate NULL columns
inserted so that it actually matches the declared rowtype. It seemed
convenient to use a JunkFilter for this, so I made some cleanups and
simplifications in the JunkFilter code to allow it to support this
additional functionality. (That in turn exposed a latent bug in
nodeAppend.c, which is that it was returning a tuple slot whose
descriptor didn't match its data.) Also, move check_sql_fn_retval
out of pg_proc.c and into functions.c, where it seems to more naturally
belong.
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
-rw-r--r-- | src/backend/optimizer/util/clauses.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 1f848cd9bdb..b6ac7786aa7 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.181 2004/10/02 22:39:48 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.182 2004/10/07 18:38:49 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -23,6 +23,7 @@ #include "catalog/pg_proc.h" #include "catalog/pg_type.h" #include "executor/executor.h" +#include "executor/functions.h" #include "miscadmin.h" #include "nodes/makefuncs.h" #include "optimizer/clauses.h" @@ -2116,7 +2117,7 @@ inline_function(Oid funcid, Oid result_type, List *args, */ if (polymorphic) (void) check_sql_fn_retval(result_type, get_typtype(result_type), - querytree_list); + querytree_list, NULL); /* * Additional validity checks on the expression. It mustn't return a |