[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

@ -380,18 +380,16 @@ int ObExprOracleDecode::calc_result_type_for_literal(ObExprResType &type,
ObObj *obj_stack = NULL;
ObArenaAllocator allocator;
const ObSQLSessionInfo *session = NULL;
const ObTimeZoneInfo *tz_info = NULL;
const ObTimeZoneInfo *tz_info = type_ctx.get_local_tz_wrap().get_time_zone_info();
ObSQLMode sql_mode = type_ctx.get_sql_mode();
int64_t tz_offset = 0;
ObExprCtx expr_ctx;
if (OB_ISNULL(session = static_cast<const ObSQLSessionInfo*>(type_ctx.get_session()))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session is NULL", K(ret));
} else if (OB_ISNULL(tz_info = get_timezone_info(session))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get tz info pointer is null", K(ret));
} else if (OB_FAIL(get_tz_offset(tz_info, tz_offset))) {
LOG_WARN("get tz offset failed", K(ret));
} else if (OB_FAIL(ObSQLUtils::get_default_cast_mode(session, expr_ctx.cast_mode_))) {
} else if (OB_FALSE_IT(ObSQLUtils::get_default_cast_mode(sql_mode, expr_ctx.cast_mode_))) {
LOG_WARN("failed to get default cast mode", K(ret));
} else if (OB_ISNULL(obj_stack = static_cast<ObObj*>(allocator.alloc(sizeof(ObObj) * param_num)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
@ -579,5 +577,14 @@ OB_SERIALIZE_MEMBER(ObExprOracleDecode,
id_,
param_flags_);
DEF_SET_LOCAL_SESSION_VARS(ObExprOracleDecode, raw_expr) {
int ret = OB_SUCCESS;
SET_LOCAL_SYSVAR_CAPACITY(3);
EXPR_ADD_LOCAL_SYSVAR(share::SYS_VAR_SQL_MODE);
EXPR_ADD_LOCAL_SYSVAR(share::SYS_VAR_TIME_ZONE);
EXPR_ADD_LOCAL_SYSVAR(share::SYS_VAR_COLLATION_CONNECTION);
return ret;
}
} // namespace sql
} // namespace oceanbase