|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.194 2005/04/10 20:57:32 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.195 2005/04/14 21:44:09 tgl Exp $ |
12 | 12 | * |
13 | 13 | * HISTORY |
14 | 14 | * AUTHORDATEMAJOR EVENT |
|
19 | 19 |
|
20 | 20 | #include"postgres.h" |
21 | 21 |
|
| 22 | +#include"access/heapam.h" |
22 | 23 | #include"catalog/pg_aggregate.h" |
23 | 24 | #include"catalog/pg_language.h" |
24 | 25 | #include"catalog/pg_operator.h" |
@@ -2103,6 +2104,16 @@ evaluate_function(Oid funcid, Oid result_type, List *args, |
2103 | 2104 | if (funcform->proretset) |
2104 | 2105 | returnNULL; |
2105 | 2106 |
|
| 2107 | +/* |
| 2108 | + * Can't simplify if it returns RECORD, except in the case where it has |
| 2109 | + * OUT parameters, since it will be needing an expected tupdesc which we |
| 2110 | + * can't supply here. |
| 2111 | + */ |
| 2112 | +if (funcform->prorettype==RECORDOID&& |
| 2113 | +(heap_attisnull(func_tuple,Anum_pg_proc_proallargtypes)|| |
| 2114 | +heap_attisnull(func_tuple,Anum_pg_proc_proargmodes))) |
| 2115 | +returnNULL; |
| 2116 | + |
2106 | 2117 | /* |
2107 | 2118 | * Check for constant inputs and especially constant-NULL inputs. |
2108 | 2119 | */ |
|