get_expr_result_type probably needs to be able to handle OpExpr as well
authorTom Lane <[email protected]>
Mon, 25 Apr 2005 20:59:44 +0000 (20:59 +0000)
committerTom Lane <[email protected]>
Mon, 25 Apr 2005 20:59:44 +0000 (20:59 +0000)
as FuncExpr, to cover cases where a function returning tuple is invoked
via an operator.

src/backend/utils/fmgr/funcapi.c

index 0500662b67b90a169df8874356e4820d7b2faba5..300a20e94ddbd28366da2fd2ac65df79ebc3a121 100644 (file)
@@ -229,6 +229,12 @@ get_expr_result_type(Node *expr,
                                                                                  NULL,
                                                                                  resultTypeId,
                                                                                  resultTupleDesc);
+       else if (expr && IsA(expr, OpExpr))
+               result = internal_get_result_type(get_opcode(((OpExpr *) expr)->opno),
+                                                                                 expr,
+                                                                                 NULL,
+                                                                                 resultTypeId,
+                                                                                 resultTupleDesc);
        else
        {
                /* handle as a generic expression; no chance to resolve RECORD */
@@ -247,7 +253,7 @@ get_expr_result_type(Node *expr,
 }
 
 /*
- * get_expr_result_type
+ * get_func_result_type
  *             As above, but work from a function's OID only
  *
  * This will not be able to resolve pure-RECORD results nor polymorphism.