[CP] [to #52465107] fix access collection element with varchar symbol index

This commit is contained in:
obdev 2023-10-10 13:43:49 +00:00 committed by ob-robot
parent 4cdbc3e93b
commit a36e27e80b

View File

@ -14165,11 +14165,15 @@ int ObPLResolver::build_collection_attribute_access(ObRawExprFactory &expr_facto
access_idx.get_sysfunc_ = NULL;
}
} else {
access_idx.access_type_ = ObObjAccessIdx::AccessType::IS_LOCAL;
access_idx.var_index_ = const_expr->get_value().get_unknown();
const ObPLVar *var = NULL;
CK (OB_NOT_NULL(ns.get_symbol_table()));
CK (OB_NOT_NULL(ns.get_symbol_table()->get_symbol(access_idx.var_index_)));
if (OB_SUCC(ret)) {
CK (OB_NOT_NULL(var = ns.get_symbol_table()->get_symbol(const_expr->get_value().get_unknown())));
if (OB_SUCC(ret)
&& (ob_is_int_tc(var->get_type().get_obj_type())
|| ob_is_uint_tc(var->get_type().get_obj_type())
|| ob_is_number_tc(var->get_type().get_obj_type()))) {
access_idx.access_type_ = ObObjAccessIdx::AccessType::IS_LOCAL;
access_idx.var_index_ = const_expr->get_value().get_unknown();
access_idx.var_name_ = ns.get_symbol_table()->get_symbol(access_idx.var_index_)->get_name();
}
}