Skip to content

Commit 3117e01

Browse files
author
Mohit Raj
committed
enumeration
1 parent 2e9d6b5 commit 3117e01

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

contrib/babelfishpg_tsql/src/pltsql_coerce.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3207,8 +3207,18 @@ select_common_type_setop(ParseState *pstate, List *exprs, Node **which_expr, con
32073207
continue;
32083208
else if (is_tsql_str_const(expr))
32093209
type = common_utility_plugin_ptr->lookup_tsql_datatype_oid("varchar");
3210-
else if ((!is_tsql_char_type_with_len(type, is_case_expr)))
3211-
return InvalidOid;
3210+
else if ((!is_tsql_char_type_with_len(type, is_case_expr)))
3211+
{
3212+
if (is_case_expr && is_tsql_base_datatype(type))
3213+
{
3214+
// Type exists in tsql_precedence_infos — allow through
3215+
// to the precedence comparison below
3216+
}
3217+
else
3218+
{
3219+
return InvalidOid;
3220+
}
3221+
}
32123222

32133223
if (tsql_has_higher_precedence(type, result_type) || result_type == InvalidOid)
32143224
{

0 commit comments

Comments
 (0)