]> granicus.if.org Git - postgresql/commitdiff
Don't try to constant-fold functions returning RECORD, since the optimizer
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 14 Apr 2005 21:44:35 +0000 (21:44 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 14 Apr 2005 21:44:35 +0000 (21:44 +0000)
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

index ae0c387e69a6a51427aad8ecbd19eeca5132ec4c..75c1e9477926b7baeec539d9b8858e2cc7fc38f8 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.154.2.3 2005/04/10 20:58:03 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.154.2.4 2005/04/14 21:44:35 tgl Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -1667,6 +1667,13 @@ evaluate_function(Oid funcid, Oid result_type, List *args,
        if (funcform->proretset)
                return NULL;
 
+       /*
+        * Can't simplify if it returns RECORD, since it will be needing an
+        * expected tupdesc which we can't supply here.
+        */
+       if (funcform->prorettype == RECORDOID)
+               return NULL;
+
        /*
         * Check for constant inputs and especially constant-NULL inputs.
         */