diff --git a/src/sql/engine/expr/ob_expr_ifnull.cpp b/src/sql/engine/expr/ob_expr_ifnull.cpp index 0846af58fb5bcae54585ddcd885ce011853a2b8c..1383076a420d0ad3eb2f126bd3e5b3d41f082dac 100644 --- a/src/sql/engine/expr/ob_expr_ifnull.cpp +++ b/src/sql/engine/expr/ob_expr_ifnull.cpp @@ -40,7 +40,7 @@ int ObExprIfNull::calc_result_type2( LOG_WARN("session is NULL", K(ret)); } else if (OB_FAIL(ObExprPromotionUtil::get_nvl_type(type, type1, type2))) { LOG_WARN("failed to get nvl type", K(ret)); - } else if (ob_is_string_type(type.get_type())) { + } else if (ob_is_string_type(type.get_type()) || ob_is_json_tc(type.get_type())) { ObCollationLevel res_cs_level = CS_LEVEL_INVALID; ObCollationType res_cs_type = CS_TYPE_INVALID; if (OB_FAIL(ObCharset::aggregate_collation(type1.get_collation_level(), diff --git a/src/sql/engine/expr/ob_expr_relational_cmp_type.map b/src/sql/engine/expr/ob_expr_relational_cmp_type.map index 77b604a3c782869173a23b3ab3b428e6635e13ff..776e58a02567d389726a930250f75ed6014dba0d 100644 --- a/src/sql/engine/expr/ob_expr_relational_cmp_type.map +++ b/src/sql/engine/expr/ob_expr_relational_cmp_type.map @@ -1779,7 +1779,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] = ObVarcharType, /* ObNCharType */ ObNullType, /* ObURowIDType */ ObNullType, /* ObLobType */ - ObMaxType, /* ObJsonType */ + ObNumberType, /* ObJsonType */ }, /*EnumInnerType*/ { @@ -2480,7 +2480,7 @@ static ObObjType RELATIONAL_CMP_TYPE[ObMaxType][ObMaxType] = ObJsonType, /*LongTextType*/ ObJsonType, /*BitType*/ ObMaxType, /* EnumType */ - ObMaxType, /* SetType */ + ObNumberType, /* SetType */ ObMaxType, /* EnumInnerType */ ObMaxType, /* SetInnerType */ ObTimestampTZType, /* ObTimestampTZType */