]> granicus.if.org Git - postgresql/commitdiff
Fix bug in recent improvement to type resolution code. Forgot to retain
authorThomas G. Lockhart <lockhart@fourpalms.org>
Sat, 11 Nov 2000 19:49:26 +0000 (19:49 +0000)
committerThomas G. Lockhart <lockhart@fourpalms.org>
Sat, 11 Nov 2000 19:49:26 +0000 (19:49 +0000)
 "best choice" type category when resolving UNKNOWN function and operator
 arguments. Thanks to Tom Lane for finding test case.

src/backend/parser/parse_func.c
src/backend/parser/parse_oper.c

index 9805e8df93c085c6595fccf59a2dc70a48692dff..ea0544f701e97cfd0a3cc7044ea05c095737aa54 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.92 2000/11/06 15:42:30 thomas Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.93 2000/11/11 19:49:26 thomas Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -951,6 +951,8 @@ func_select_candidate(int nargs,
                                        /* started out as unknown type, so give preference to string type, if available */
                                        if (current_category == STRING_TYPE)
                                        {
+                                               slot_category = current_category;
+                                               slot_type = current_type;
                                                /* forget all previous candidates */
                                                candidates = current_candidate;
                                                last_candidate = current_candidate;
index 7b30131251e1c4027bfbbfee4f676ea11e80e004..7d3919a1fc6edf5d059d3d16068cd08fedb362c9 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.42 2000/11/07 16:01:01 thomas Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.43 2000/11/11 19:49:26 thomas Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -435,6 +435,7 @@ oper_select_candidate(int nargs,
                                current_typeids = current_candidate->args;
                                current_type = current_typeids[i];
                                current_category = TypeCategory(current_type);
+                               /* first time through? Then we'll use this one for now */
                                if (slot_category == INVALID_TYPE)
                                {
                                        slot_category = current_category;
@@ -446,6 +447,8 @@ oper_select_candidate(int nargs,
                                        /* started out as unknown type, so give preference to string type, if available */
                                        if (current_category == STRING_TYPE)
                                        {
+                                               slot_category = current_category;
+                                               slot_type = current_type;
                                                /* forget all previous candidates */
                                                candidates = current_candidate;
                                                last_candidate = current_candidate;