summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-04-14 21:44:46 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-04-14 21:44:46 +0000
commitaa4762e7c8892bcf76637f451a9220b8a14019c5 (patch)
tree00ba6ac190cce3ec471c80ef16ac41a7b2442d97
parent536b3af7e3b46140e5d37491569aa26d7e517ab6 (diff)
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.
-rw-r--r--src/backend/optimizer/util/clauses.c9
1 files changed, 8 insertions, 1 deletions
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
@@ -1621,6 +1621,13 @@ simplify_op_or_func(Expr *expr, List *args)
}
/*
+ * 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.
*/