[FEAT MERGE] 424 SQL compatibility patch 433

Co-authored-by: wjhh2008 <wjh2006-1@163.com>
Co-authored-by: GongYusen <986957406@qq.com>
Co-authored-by: hy-guo <fqboyg@gmail.com>
This commit is contained in:
jingtaoye35
2024-08-23 03:32:01 +00:00
committed by ob-robot
parent cb61323917
commit e537a0c479
296 changed files with 21588 additions and 4122 deletions

View File

@ -86,7 +86,7 @@ int ObExprNullif::se_deduce_type(ObExprResType &type,
} else if (ob_is_enumset_tc(type.get_type()) || ob_is_enumset_inner_tc(type.get_type())) {
type.set_varchar();
}
OZ(calc_cmp_type2(cmp_type, type1, type2, type_ctx.get_coll_type()));
OZ(calc_cmp_type2(cmp_type, type1, type2, type_ctx));
if (OB_SUCC(ret)) {
if (ob_is_enumset_tc(type1.get_type()) || ob_is_enumset_tc(type2.get_type())) {
ObObjType calc_type = enumset_calc_types_[OBJ_TYPE_TO_CLASS[cmp_type.get_calc_type()]];
@ -102,6 +102,7 @@ int ObExprNullif::se_deduce_type(ObExprResType &type,
// implicit cast from enum_inner to uint64 will be added on EnumToInner expression.
type1.set_calc_type(calc_type);
type1.set_calc_collation_type(cmp_type.get_calc_collation_type());
type1.set_calc_collation_level(cmp_type.get_calc_collation_level());
}
}
if (type1.is_decimal_int()) {
@ -110,6 +111,7 @@ int ObExprNullif::se_deduce_type(ObExprResType &type,
// set calc type for type2 no matter whether calc_type is varchar or not, and no matther which param is enum.
type2.set_calc_type(calc_type);
type2.set_calc_collation_type(cmp_type.get_calc_collation_type());
type2.set_calc_collation_level(cmp_type.get_calc_collation_level());
}
}
if (OB_FAIL(ret)) {