From aa4762e7c8892bcf76637f451a9220b8a14019c5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 14 Apr 2005 21:44:46 +0000 Subject: [PATCH] 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. --- src/backend/optimizer/util/clauses.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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. -- 2.39.5