Skip to content

Commit cfa4d4d

Browse files
committed
Tweak select_common_type() to deal with possibility of multiple preferred
types in a category --- it was taking the last preferred type among the inputs, rather than the first one as intended.
1 parent 0c2629e commit cfa4d4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/parser/parse_coerce.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.51 2000/12/15 18:02:47 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.52 2000/12/17 04:32:29 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -364,6 +364,7 @@ select_common_type(List *typeids, const char *context)
364364
context, typeidTypeName(ptype), typeidTypeName(ntype));
365365
}
366366
else if (IsPreferredType(pcategory, ntype)
367+
&& !IsPreferredType(pcategory, ptype)
367368
&& can_coerce_type(1, &ptype, &ntype))
368369
{
369370
/*

0 commit comments

Comments
 (0)