aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>2000-11-11 19:49:26 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>2000-11-11 19:49:26 +0000
commitbc20c41275ecc52fc772f92b77fa6a35dc174460 (patch)
treecab4e381bddf8a5f303eb0fdad2a0298e0fa5e40 /src
parenta8555ad4f9faab8e987c9f8d5476b07933573af1 (diff)
downloadpostgresql-bc20c41275ecc52fc772f92b77fa6a35dc174460.tar.gz
postgresql-bc20c41275ecc52fc772f92b77fa6a35dc174460.zip
Fix bug in recent improvement to type resolution code. Forgot to retain
"best choice" type category when resolving UNKNOWN function and operator arguments. Thanks to Tom Lane for finding test case.
Diffstat (limited to 'src')
-rw-r--r--src/backend/parser/parse_func.c4
-rw-r--r--src/backend/parser/parse_oper.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 9805e8df93c..ea0544f701e 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -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;
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 7b30131251e..7d3919a1fc6 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -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;