patch 4.0

This commit is contained in:
wangzelin.wzl
2022-10-24 10:34:53 +08:00
parent 4ad6e00ec3
commit 93a1074b0c
10533 changed files with 2588271 additions and 2299373 deletions

View File

@ -19,15 +19,21 @@
using namespace oceanbase::common;
using namespace oceanbase::sql;
namespace oceanbase {
namespace sql {
namespace oceanbase
{
namespace sql
{
ObExprStrcmp::ObExprStrcmp(ObIAllocator& alloc)
ObExprStrcmp::ObExprStrcmp(ObIAllocator &alloc)
: ObRelationalExprOperator::ObRelationalExprOperator(alloc, T_FUN_SYS_STRCMP, N_STRCMP, 2, NOT_ROW_DIMENSION)
{}
{
}
int ObExprStrcmp::calc_result_type2(
ObExprResType& type, ObExprResType& type1, ObExprResType& type2, ObExprTypeCtx& type_ctx) const
int ObExprStrcmp::calc_result_type2(ObExprResType &type,
ObExprResType &type1,
ObExprResType &type2,
ObExprTypeCtx &type_ctx) const
{
UNUSED(type2);
UNUSED(type_ctx);
@ -38,11 +44,11 @@ int ObExprStrcmp::calc_result_type2(
ObCollationType coll_type = CS_TYPE_INVALID;
ObCollationLevel coll_level = CS_LEVEL_EXPLICIT;
ret = ObCharset::aggregate_collation(type1.get_collation_level(),
type1.get_collation_type(),
type2.get_collation_level(),
type2.get_collation_type(),
coll_level,
coll_type);
type1.get_collation_type(),
type2.get_collation_level(),
type2.get_collation_type(),
coll_level,
coll_type);
type.set_calc_type(ObVarcharType);
type.set_calc_collation_type(coll_type);
type.set_calc_collation_level(coll_level);
@ -54,24 +60,6 @@ int ObExprStrcmp::calc_result_type2(
return ret;
}
int ObExprStrcmp::calc_result2(ObObj& result, const ObObj& obj1, const ObObj& obj2, ObExprCtx& expr_ctx) const
{
int ret = OB_SUCCESS;
if (obj1.is_null() || obj2.is_null()) {
result.set_null();
} else if (OB_ISNULL(cmp_op_func2_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected error. cmp func is null", K(obj1), K(obj2), K(common::lbt()));
} else {
TYPE_CHECK(obj1, ObVarcharType);
TYPE_CHECK(obj2, ObVarcharType);
EXPR_DEFINE_CMP_CTX(result_type_.get_calc_meta(), false, expr_ctx);
if (OB_FAIL(compare_nocast(result, obj1, obj2, cmp_ctx, CO_CMP, cmp_op_func2_))) {
LOG_WARN("failed to compare objects", K(ret), K(obj1), K(obj2));
}
}
return ret;
}
}//end sql namespace
}//end oceanbase namespace
} // namespace sql
} // namespace oceanbase