[FEAT MERGE] Solidify session vars for functional index

This commit is contained in:
2149
2023-12-12 06:42:36 +00:00
committed by ob-robot
parent db82b0b5cd
commit 58aad590f1
189 changed files with 3671 additions and 1554 deletions

View File

@ -27,28 +27,6 @@ namespace oceanbase
namespace sql
{
int internal_calc_result_type(common::ObObj &result, const ObObj &text,
const ObExprResType &result_type, ObExprCtx &expr_ctx)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(expr_ctx.calc_buf_)) {
ret = OB_NOT_INIT;
LOG_WARN("varchar buffer not init", K(ret));
} else {
EXPR_DEFINE_CAST_CTX(expr_ctx, CM_NONE);
if (OB_FAIL(ObHexUtils::rawtohex(text, cast_ctx, result))) {
LOG_WARN("fail to calc", K(ret), K(text));
} else if (OB_LIKELY(!result.is_null())) {
if (!ObCharset::is_cs_nonascii(result_type.get_collation_type())) {
result.set_collation(result_type);
} else {
OZ (ObStringExprOperator::convert_result_collation(result_type, result, expr_ctx.calc_buf_));
}
}
}
return ret;
}
int internal_calc_result_length(ObExprResType &type, ObExprResType &text)
{
int ret = OB_SUCCESS;
@ -94,7 +72,7 @@ int ObExprRawtohex::calc_result_type1(ObExprResType &type, ObExprResType &text,
} else {
type.set_varchar();
type.set_collation_level(CS_LEVEL_IMPLICIT);
type.set_collation_type(get_default_collation_type(type.get_type(), *type_ctx.get_session()));
type.set_collation_type(get_default_collation_type(type.get_type(), type_ctx));
type.set_length_semantics(type_ctx.get_session()->get_actual_nls_length_semantics());
}
//calc length now...