[CP] Check ret code for ObSqlBitSet::add_member()
This commit is contained in:
parent
7d285d45d4
commit
493b2fb2e2
@ -362,7 +362,7 @@ int ObStaticEngineCG::set_specific_flag_to_exprs(const ObIArray<ObRawExpr*>& exp
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("expr is null", K(ret), K(i), K(exprs));
|
||||
} else {
|
||||
exprs.at(i)->add_flag(flag);
|
||||
OZ(exprs.at(i)->add_flag(flag));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4199,7 +4199,7 @@ int ObOptimizerUtil::simplify_ordered_exprs(const ObFdItemSet& fd_item_set, cons
|
||||
}
|
||||
if (OB_FAIL(ret)) {
|
||||
/*do nothing*/
|
||||
} else if (checked_fd_item.add_member(fd_idx)) {
|
||||
} else if (OB_FAIL(checked_fd_item.add_member(fd_idx))) {
|
||||
LOG_WARN("failed to add member", K(ret));
|
||||
} else if (OB_FAIL(split_child_exprs(fd_item, equal_sets, fd_set_parent_exprs, extended_order_exprs))) {
|
||||
LOG_WARN("failed to delete members", K(ret));
|
||||
|
@ -141,8 +141,8 @@ int ObAlterTablegroupResolver::resolve_partition_options(const ParseNode& node)
|
||||
ParseNode* partition_node = node.children_[0];
|
||||
if (OB_FAIL(resolve_add_partition(*partition_node))) {
|
||||
SQL_RESV_LOG(WARN, "Resolve add partition error!", K(ret));
|
||||
} else {
|
||||
arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::ADD_PARTITION);
|
||||
} else if (OB_FAIL(arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::ADD_PARTITION))) {
|
||||
LOG_WARN("failed to add member", K(ret));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -150,8 +150,8 @@ int ObAlterTablegroupResolver::resolve_partition_options(const ParseNode& node)
|
||||
ParseNode* partition_node = node.children_[0];
|
||||
if (OB_FAIL(resolve_drop_partition(*partition_node))) {
|
||||
SQL_RESV_LOG(WARN, "Resolve drop partition error!", K(ret));
|
||||
} else {
|
||||
arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::DROP_PARTITION);
|
||||
} else if (OB_FAIL(arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::DROP_PARTITION))) {
|
||||
LOG_WARN("failed to add member", K(ret));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -174,8 +174,8 @@ int ObAlterTablegroupResolver::resolve_partition_options(const ParseNode& node)
|
||||
} else if (OB_FAIL(resolve_partition_table_option(
|
||||
alter_tablegroup_stmt, partition_node->children_[0], arg.alter_tablegroup_schema_))) {
|
||||
LOG_WARN("fail to resolve partition node", K(ret), K(partition_node));
|
||||
} else {
|
||||
arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::PARTITIONED_TABLE);
|
||||
} else if (OB_FAIL(arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::PARTITIONED_TABLE))) {
|
||||
LOG_WARN("failed to add member", K(ret));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -198,8 +198,8 @@ int ObAlterTablegroupResolver::resolve_partition_options(const ParseNode& node)
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "reorganize partition");
|
||||
} else if (OB_FAIL(resolve_reorganize_partition(*partition_node))) {
|
||||
LOG_WARN("failed to reorganize partition", K(ret));
|
||||
} else {
|
||||
arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::REORGANIZE_PARTITION);
|
||||
} else if (OB_FAIL(arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::REORGANIZE_PARTITION))) {
|
||||
LOG_WARN("failed to add member", K(ret));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -222,8 +222,8 @@ int ObAlterTablegroupResolver::resolve_partition_options(const ParseNode& node)
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "split partition");
|
||||
} else if (OB_FAIL(resolve_split_partition(*partition_node))) {
|
||||
LOG_WARN("failed to reorganize partition", K(ret));
|
||||
} else {
|
||||
arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::SPLIT_PARTITION);
|
||||
} else if (OB_FAIL(arg.alter_option_bitset_.add_member(obrpc::ObAlterTablegroupArg::SPLIT_PARTITION))) {
|
||||
LOG_WARN("failed to add member", K(ret));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -9812,7 +9812,7 @@ int ObDMLResolver::resolve_pseudo_column(const ObQualifiedName& q_name, ObRawExp
|
||||
pseudo_column_expr->set_data_type(ObIntType);
|
||||
pseudo_column_expr->set_accuracy(ObAccuracy::MAX_ACCURACY[ObIntType]);
|
||||
pseudo_column_expr->set_table_id(table_item->table_id_);
|
||||
pseudo_column_expr->add_relation_id(get_stmt()->get_table_bit_index(table_item->table_id_));
|
||||
OZ(pseudo_column_expr->add_relation_id(get_stmt()->get_table_bit_index(table_item->table_id_)));
|
||||
pseudo_column_expr->set_expr_level(current_level_);
|
||||
real_ref_expr = pseudo_column_expr;
|
||||
OZ(get_stmt()->get_pseudo_column_like_exprs().push_back(pseudo_column_expr));
|
||||
|
@ -3293,8 +3293,9 @@ int ObSelectResolver::gen_unpivot_target_column(
|
||||
if (OB_FAIL(ObRawExprUtils::create_cast_expr(
|
||||
*params_.expr_factory_, select_item.expr_, res_type, new_expr, session_info_))) {
|
||||
LOG_WARN("create cast expr for stmt failed", K(ret));
|
||||
} else if (OB_FAIL(new_expr->add_flag(IS_INNER_ADDED_EXPR))) {
|
||||
LOG_WARN("failed to add flag", K(ret));
|
||||
} else {
|
||||
new_expr->add_flag(IS_INNER_ADDED_EXPR);
|
||||
select_item.expr_ = new_expr;
|
||||
LOG_DEBUG("add cast for column", K(select_item), K(res_type));
|
||||
}
|
||||
@ -5711,10 +5712,8 @@ int ObSelectResolver::resolve_fetch_clause(const ParseNode* node)
|
||||
OZ(ObRawExprUtils::create_cast_expr(
|
||||
*params_.expr_factory_, limit_offset, dst_type, cast_expr, session_info_));
|
||||
CK(NULL != cast_expr);
|
||||
if (OB_SUCC(ret)) {
|
||||
limit_offset = cast_expr;
|
||||
limit_offset->add_flag(IS_INNER_ADDED_EXPR);
|
||||
}
|
||||
OX(limit_offset = cast_expr);
|
||||
OZ(limit_offset->add_flag(IS_INNER_ADDED_EXPR));
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
@ -5749,10 +5748,8 @@ int ObSelectResolver::resolve_fetch_clause(const ParseNode* node)
|
||||
OZ(ObRawExprUtils::create_cast_expr(
|
||||
*params_.expr_factory_, limit_count, dst_type, cast_expr, session_info_));
|
||||
CK(NULL != cast_expr);
|
||||
if (OB_SUCC(ret)) {
|
||||
limit_count = cast_expr;
|
||||
limit_count->add_flag(IS_INNER_ADDED_EXPR);
|
||||
}
|
||||
OX(limit_count = cast_expr);
|
||||
OZ(limit_count->add_flag(IS_INNER_ADDED_EXPR));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5773,10 +5770,8 @@ int ObSelectResolver::resolve_fetch_clause(const ParseNode* node)
|
||||
OZ(ObRawExprUtils::create_cast_expr(
|
||||
*params_.expr_factory_, limit_percent, dst_type, cast_expr, session_info_));
|
||||
CK(NULL != cast_expr);
|
||||
if (OB_SUCC(ret)) {
|
||||
limit_percent = cast_expr;
|
||||
limit_percent->add_flag(IS_INNER_ADDED_EXPR);
|
||||
}
|
||||
OX(limit_percent = cast_expr);
|
||||
OZ(limit_percent->add_flag(IS_INNER_ADDED_EXPR));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -298,10 +298,10 @@ public:
|
||||
SQL_RESV_LOG(WARN, "failed to alloc new buf", K(ret));
|
||||
}
|
||||
}
|
||||
if (pos >= desc_.len_) {
|
||||
desc_.len_ = static_cast<int16_t>(pos) + 1;
|
||||
}
|
||||
if (OB_SUCC(ret)) {
|
||||
if (pos >= desc_.len_) {
|
||||
desc_.len_ = static_cast<int16_t>(pos) + 1;
|
||||
}
|
||||
bit_set_word_array_[pos] |= ((BitSetWord)1 << (index & PER_BITSETWORD_MASK));
|
||||
}
|
||||
}
|
||||
|
@ -2449,10 +2449,11 @@ int ObRawExprDeduceType::try_add_cast_expr_above_for_deduce_type(
|
||||
cast_dst_type.set_length(child_res_type.get_length());
|
||||
}
|
||||
OZ(ObRawExprUtils::try_add_cast_expr_above(expr_factory_, my_session_, expr, cast_dst_type, cm, new_expr));
|
||||
if (OB_SUCC(ret)) {
|
||||
ObRawExpr* e = new_expr;
|
||||
while (NULL != e && e != &expr && T_FUN_SYS_CAST == e->get_expr_type()) {
|
||||
e->add_flag(IS_OP_OPERAND_IMPLICIT_CAST);
|
||||
ObRawExpr *e = new_expr;
|
||||
while (OB_SUCC(ret) && NULL != e && e != &expr && T_FUN_SYS_CAST == e->get_expr_type()) {
|
||||
if (OB_FAIL(e->add_flag(IS_OP_OPERAND_IMPLICIT_CAST))) {
|
||||
LOG_WARN("failed to add flag", K(ret));
|
||||
} else {
|
||||
e = e->get_param_expr(0);
|
||||
}
|
||||
}
|
||||
|
@ -107,14 +107,16 @@ int ObRawExprInfoExtractor::visit(ObColumnRefRawExpr& expr)
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void ObRawExprInfoExtractor::clear_info(ObRawExpr& expr)
|
||||
int ObRawExprInfoExtractor::clear_info(ObRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObExprInfo& expr_info = expr.get_expr_info();
|
||||
bool is_implicit_cast = expr_info.has_member(IS_OP_OPERAND_IMPLICIT_CAST);
|
||||
expr_info.reset();
|
||||
if (is_implicit_cast) {
|
||||
expr_info.add_member(IS_OP_OPERAND_IMPLICIT_CAST);
|
||||
OZ(expr_info.add_member(IS_OP_OPERAND_IMPLICIT_CAST));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObRawExprInfoExtractor::pull_info(ObRawExpr& expr)
|
||||
@ -241,8 +243,9 @@ int ObRawExprInfoExtractor::visit(ObOpRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
const bool is_inner_added = expr.has_flag(IS_INNER_ADDED_EXPR);
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(pull_info(expr))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(pull_info(expr))) {
|
||||
LOG_WARN("fail to add pull info", K(ret));
|
||||
} else if (is_inner_added && OB_FAIL(expr.add_flag(IS_INNER_ADDED_EXPR))) {
|
||||
LOG_WARN("add flag failed", K(ret));
|
||||
@ -453,8 +456,9 @@ ObItemType ObRawExprInfoExtractor::get_subquery_comparison_type(ObItemType cmp_t
|
||||
int ObRawExprInfoExtractor::visit(ObCaseOpRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(pull_info(expr))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(pull_info(expr))) {
|
||||
LOG_WARN("fail to add pull info", K(ret));
|
||||
} else if (OB_FAIL(add_const(expr))) {
|
||||
LOG_WARN("fail to add const", K(expr), K(ret));
|
||||
@ -466,8 +470,9 @@ int ObRawExprInfoExtractor::visit(ObCaseOpRawExpr& expr)
|
||||
int ObRawExprInfoExtractor::visit(ObAggFunRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(pull_info(expr))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(pull_info(expr))) {
|
||||
LOG_WARN("fail to add pull info", K(ret));
|
||||
} else if (OB_FAIL(expr.add_flag(IS_AGG))) {
|
||||
LOG_WARN("failed to add flag IS_AGG", K(ret));
|
||||
@ -480,8 +485,9 @@ int ObRawExprInfoExtractor::visit(ObSysFunRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
const bool is_inner_added = expr.has_flag(IS_INNER_ADDED_EXPR);
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(pull_info(expr))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(pull_info(expr))) {
|
||||
LOG_WARN("fail to add pull info", K(ret));
|
||||
} else if (OB_FAIL(add_const(expr))) {
|
||||
LOG_WARN("fail to add const", K(expr), K(ret));
|
||||
@ -628,8 +634,9 @@ int ObRawExprInfoExtractor::visit(ObSysFunRawExpr& expr)
|
||||
int ObRawExprInfoExtractor::visit(ObSetOpRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(expr.add_flag(IS_SET_OP))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(expr.add_flag(IS_SET_OP))) {
|
||||
LOG_WARN("failed to add flag IS_SET_OP", K(ret));
|
||||
}
|
||||
return ret;
|
||||
@ -638,8 +645,9 @@ int ObRawExprInfoExtractor::visit(ObSetOpRawExpr& expr)
|
||||
int ObRawExprInfoExtractor::visit(ObAliasRefRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(expr.add_flag(IS_ALIAS))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(expr.add_flag(IS_ALIAS))) {
|
||||
LOG_WARN("failed to add flag", K(ret));
|
||||
} else if (OB_ISNULL(expr.get_ref_expr())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
@ -657,8 +665,9 @@ int ObRawExprInfoExtractor::visit(ObAliasRefRawExpr& expr)
|
||||
int ObRawExprInfoExtractor::visit(ObFunMatchAgainst& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(pull_info(expr))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(pull_info(expr))) {
|
||||
LOG_WARN("pull match against info failed", K(ret));
|
||||
} else if (OB_FAIL(expr.add_flag(IS_DOMAIN_INDEX_FUNC))) {
|
||||
LOG_WARN("add flag to match against failed", K(ret));
|
||||
@ -669,8 +678,9 @@ int ObRawExprInfoExtractor::visit(ObFunMatchAgainst& expr)
|
||||
int ObRawExprInfoExtractor::visit(ObWinFunRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(pull_info(expr))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(pull_info(expr))) {
|
||||
LOG_WARN("pull match info failed", K(ret));
|
||||
} else if (OB_FAIL(expr.add_flag(IS_WINDOW_FUNC))) {
|
||||
LOG_WARN("add flag failed", K(ret));
|
||||
@ -683,8 +693,9 @@ int ObRawExprInfoExtractor::visit(ObWinFunRawExpr& expr)
|
||||
int ObRawExprInfoExtractor::visit(ObPseudoColumnRawExpr& expr)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
clear_info(expr);
|
||||
if (OB_FAIL(expr.add_flag(IS_PSEUDO_COLUMN))) {
|
||||
if (OB_FAIL(clear_info(expr))) {
|
||||
LOG_WARN("fail to clear info", K(ret));
|
||||
} else if (OB_FAIL(expr.add_flag(IS_PSEUDO_COLUMN))) {
|
||||
LOG_WARN("add flag fail", K(ret));
|
||||
} else if (T_LEVEL == expr.get_expr_type()) {
|
||||
if (OB_FAIL(expr.add_flag(IS_LEVEL))) {
|
||||
|
@ -49,7 +49,7 @@ private:
|
||||
int visit_subquery_node(ObOpRawExpr& expr);
|
||||
int visit_left_param(ObRawExpr& expr);
|
||||
int visit_right_param(ObOpRawExpr& expr);
|
||||
void clear_info(ObRawExpr& expr);
|
||||
int clear_info(ObRawExpr& expr);
|
||||
int pull_info(ObRawExpr& expr);
|
||||
int add_const(ObRawExpr& expr);
|
||||
int add_calculable(ObOpRawExpr& expr);
|
||||
|
@ -2724,7 +2724,6 @@ int ObTransformPreProcess::add_filter_for_temporary_table(ObDMLStmt& stmt, const
|
||||
expr_col->set_table_name(table_item.get_table_name());
|
||||
expr_col->set_column_name(OB_HIDDEN_SESSION_ID_COLUMN_NAME);
|
||||
expr_col->set_ref_id(table_item.table_id_, OB_HIDDEN_SESSION_ID_COLUMN_ID);
|
||||
expr_col->add_relation_id(stmt.get_table_bit_index(table_item.table_id_));
|
||||
expr_col->set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset()));
|
||||
expr_col->set_collation_level(CS_LEVEL_SYSCONST);
|
||||
expr_col->set_result_type(result_type);
|
||||
@ -2733,7 +2732,9 @@ int ObTransformPreProcess::add_filter_for_temporary_table(ObDMLStmt& stmt, const
|
||||
column_item.table_id_ = expr_col->get_table_id();
|
||||
column_item.column_id_ = expr_col->get_column_id();
|
||||
column_item.column_name_ = expr_col->get_column_name();
|
||||
if (OB_FAIL(stmt.add_column_item(column_item))) {
|
||||
if (OB_FAIL(expr_col->add_relation_id(stmt.get_table_bit_index(table_item.table_id_)))) {
|
||||
LOG_WARN("failed to add relation id", K(ret));
|
||||
} else if (OB_FAIL(stmt.add_column_item(column_item))) {
|
||||
LOG_WARN("add column item to stmt failed", K(ret));
|
||||
}
|
||||
}
|
||||
|
@ -305,7 +305,6 @@ int ObTransformUtils::create_new_column_expr(ObTransformerCtx* ctx, const TableI
|
||||
new_column_ref->set_table_name(table_item.alias_name_);
|
||||
new_column_ref->set_column_name(select_item.alias_name_);
|
||||
new_column_ref->set_ref_id(table_item.table_id_, column_id); // only one column
|
||||
new_column_ref->add_relation_id(stmt->get_table_bit_index(table_item.table_id_));
|
||||
new_column_ref->set_collation_type(select_expr->get_collation_type());
|
||||
new_column_ref->set_collation_level(select_expr->get_collation_level());
|
||||
new_column_ref->set_result_type(select_expr->get_result_type());
|
||||
@ -315,9 +314,11 @@ int ObTransformUtils::create_new_column_expr(ObTransformerCtx* ctx, const TableI
|
||||
} else {
|
||||
new_column_ref->set_result_flag(OB_MYSQL_NOT_NULL_FLAG);
|
||||
}
|
||||
if (select_expr->is_column_ref_expr()) {
|
||||
const ObColumnRefRawExpr* old_col = static_cast<const ObColumnRefRawExpr*>(select_expr);
|
||||
const ColumnItem* old_col_item = NULL;
|
||||
if (OB_FAIL(new_column_ref->add_relation_id(stmt->get_table_bit_index(table_item.table_id_)))) {
|
||||
LOG_WARN("failed to add relation id", K(ret));
|
||||
} else if (select_expr->is_column_ref_expr()) {
|
||||
const ObColumnRefRawExpr *old_col = static_cast<const ObColumnRefRawExpr *>(select_expr);
|
||||
const ColumnItem *old_col_item = NULL;
|
||||
if (OB_ISNULL(table_item.ref_query_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("table item is invalid", K(ret));
|
||||
|
Loading…
x
Reference in New Issue
Block a user