From 11a932c048975100388447ebe9f224266b48cbb0 Mon Sep 17 00:00:00 2001 From: chimyue Date: Fri, 25 Aug 2023 12:43:58 +0000 Subject: [PATCH] [CP] add ObSqlBitSet init check when create ObRawExpr --- src/sql/resolver/expr/ob_raw_expr.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sql/resolver/expr/ob_raw_expr.h b/src/sql/resolver/expr/ob_raw_expr.h index 166dc695da..c56146222b 100644 --- a/src/sql/resolver/expr/ob_raw_expr.h +++ b/src/sql/resolver/expr/ob_raw_expr.h @@ -321,6 +321,7 @@ public: int64_t bit_count() const { return static_cast(desc_.len_) * PER_BITSETWORD_BITS; } bool is_empty() const { return 0 == num_members(); } bool is_valid() const { return desc_.inited_; } + int get_init_err() const { return desc_.inited_ ? OB_SUCCESS : desc_.init_errcode_; } void clear_all() { if (!is_valid()) { @@ -4663,7 +4664,12 @@ public: raw_expr->set_allocator(allocator_); raw_expr->set_expr_factory(*this); raw_expr->set_expr_type(expr_type); - if (OB_FAIL(expr_store_.store_obj(raw_expr))) { + if (OB_FAIL(raw_expr->get_expr_info().get_init_err()) || + OB_FAIL(raw_expr->get_relation_ids().get_init_err())) { + SQL_RESV_LOG(WARN, "failed to init ObSqlBitSet", K(ret)); + raw_expr->~ExprType(); + raw_expr = NULL; + } else if (OB_FAIL(expr_store_.store_obj(raw_expr))) { SQL_RESV_LOG(WARN, "store raw expr failed", K(ret)); raw_expr->~ExprType(); raw_expr = NULL;