From: Tom Lane Date: Thu, 14 Apr 2005 21:44:46 +0000 (+0000) Subject: Don't try to constant-fold functions returning RECORD, since the optimizer X-Git-Tag: REL7_3_10~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa4762e7c8892bcf76637f451a9220b8a14019c5;p=thirdparty%2Fpostgresql.git Don't try to constant-fold functions returning RECORD, since the optimizer isn't presently set up to pass them an expected tuple descriptor. Bug has been there since 7.3 but was just recently reported by Thomas Hallgren. --- diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index ee037974769..9b8bbf87b74 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.109 2002/09/11 14:48:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.109.2.1 2005/04/14 21:44:46 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -1620,6 +1620,13 @@ simplify_op_or_func(Expr *expr, List *args) result_typeid = func->funcresulttype; } + /* + * Can't simplify if it returns RECORD, since we can't pass an expected + * tupledesc. + */ + if (result_typeid == RECORDOID) + return NULL; + /* * we could use func_volatile() here, but we need several fields out * of the func tuple, so might as well just look it up once.