diff --git a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp index ac1a90f45..e583e6e2c 100644 --- a/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp +++ b/src/observer/virtual_table/ob_all_virtual_dtl_first_cached_buffer.cpp @@ -88,9 +88,9 @@ class ObAllVirtualDtlFirstCachedBufferPoolOp { public: class ObDtlFirstBufferHashMapOp { public: - ObDtlFirstBufferHashMapOp(int64_t max_cnt, int64_t tenant_id, + ObDtlFirstBufferHashMapOp(int64_t tenant_id, ObArray* first_buffer_info) - : max_cnt_(max_cnt), tenant_id_(tenant_id), first_buffer_infos_(first_buffer_info) + : tenant_id_(tenant_id), first_buffer_infos_(first_buffer_info) {} ~ObDtlFirstBufferHashMapOp() { @@ -109,7 +109,6 @@ public: } private: - int64_t max_cnt_; int64_t tenant_id_; ObArray* first_buffer_infos_; }; @@ -126,8 +125,8 @@ public: int operator()(ObDtlLocalFirstBufferCache* buffer_cache) { int ret = OB_SUCCESS; - ObDtlFirstBufferHashTable& buffer_map = buffer_cache->get_buffer_map(); - ObDtlFirstBufferHashMapOp op(MAX_BUFFER_CNT_PER_TENANT, tenant_id_, first_buffer_infos_); + ObDtlFirstBufferHashTable &buffer_map = buffer_cache->get_buffer_map(); + ObDtlFirstBufferHashMapOp op(tenant_id_, first_buffer_infos_); if (OB_FAIL(buffer_map.foreach_refactored(op))) { LOG_WARN("failed to get channel memory manager", K(ret)); } diff --git a/src/sql/dtl/ob_dtl_channel_group.h b/src/sql/dtl/ob_dtl_channel_group.h index 5979b5c90..d53b8c1b4 100644 --- a/src/sql/dtl/ob_dtl_channel_group.h +++ b/src/sql/dtl/ob_dtl_channel_group.h @@ -24,7 +24,7 @@ namespace dtl { class ObDtlTask; class ObDtlChannel; class ObDtlChSet; -class ObDtlChannelInfo; +struct ObDtlChannelInfo; class ObDtlFlowControl; // Channel group is a bunch of channels than support communication diff --git a/src/sql/dtl/ob_dtl_fc_server.cpp b/src/sql/dtl/ob_dtl_fc_server.cpp index 0662e427c..db1e239c7 100644 --- a/src/sql/dtl/ob_dtl_fc_server.cpp +++ b/src/sql/dtl/ob_dtl_fc_server.cpp @@ -410,8 +410,7 @@ void ObDfcServer::runTimerTask() { ObLockGuard lock_guard(lock_); for (DfcHashMapIterator iter = tenant_dfc_map_.begin(); iter != tenant_dfc_map_.end(); ++iter) { - uint64_t tenant_id = iter->first; - ObTenantDfc* dfc = iter->second; + ObTenantDfc *dfc = iter->second; if (OB_ISNULL(dfc)) { LOG_WARN("null ptr, unexpected. ignore this tenant and continue", K(ret)); } else if (OB_FAIL(dfc_list.push_back(dfc))) { diff --git a/src/sql/dtl/ob_dtl_linked_buffer.h b/src/sql/dtl/ob_dtl_linked_buffer.h index 1e265ff1b..062063f48 100644 --- a/src/sql/dtl/ob_dtl_linked_buffer.h +++ b/src/sql/dtl/ob_dtl_linked_buffer.h @@ -22,7 +22,7 @@ namespace dtl { #define DTL_BROADCAST (1ULL) -class ObDtlMsgHeader; +struct ObDtlMsgHeader; class ObDtlChannel; class ObDtlDfoKey { diff --git a/src/sql/engine/aggregate/ob_hash_distinct.cpp b/src/sql/engine/aggregate/ob_hash_distinct.cpp index 4013c34bc..58d3a6544 100644 --- a/src/sql/engine/aggregate/ob_hash_distinct.cpp +++ b/src/sql/engine/aggregate/ob_hash_distinct.cpp @@ -839,7 +839,6 @@ int ObHashDistinct::ObHashDistinctCtx::get_dist_row_from_in_mem_partitions( ObNewRow* cur_row = NULL; uint64_t hash_value = 0; uint64_t bucket_idx = 0; - ObChunkRowStore* store; if (first_read_part_) { first_read_part_ = false; if (OB_FAIL(get_next_mem_partition())) { diff --git a/src/sql/engine/basic/ob_pushdown_filter.h b/src/sql/engine/basic/ob_pushdown_filter.h index d0d62bda9..6e3cc890c 100644 --- a/src/sql/engine/basic/ob_pushdown_filter.h +++ b/src/sql/engine/basic/ob_pushdown_filter.h @@ -246,7 +246,7 @@ public: col_params_(nullptr), allocator_(alloc) {} - ~ObPushdownFilterExecutor() + virtual ~ObPushdownFilterExecutor() { if (nullptr != filter_bitmap_) { filter_bitmap_->~ObBitmap(); @@ -471,7 +471,7 @@ private: class ObFilterExecutorConstructor { public: - ObFilterExecutorConstructor(common::ObIAllocator* alloc) : alloc_(alloc), factory_(alloc) + ObFilterExecutorConstructor(common::ObIAllocator* alloc) : factory_(alloc) {} int apply(ObPushdownFilterNode* filter_tree, ObPushdownFilterExecutor*& filter_executor); @@ -480,7 +480,6 @@ private: int create_filter_executor(ObPushdownFilterNode* filter_tree, ObPushdownFilterExecutor*& filter_executor); private: - common::ObIAllocator* alloc_; ObPushdownFilterFactory factory_; }; diff --git a/src/sql/engine/join/ob_hj_batch.h b/src/sql/engine/join/ob_hj_batch.h index 5fef188d5..3a8b15a43 100644 --- a/src/sql/engine/join/ob_hj_batch.h +++ b/src/sql/engine/join/ob_hj_batch.h @@ -21,19 +21,17 @@ namespace oceanbase { namespace sql { namespace join { -class ObStoredJoinRow; +struct ObStoredJoinRow; class ObHJBatch { public: - ObHJBatch(common::ObIAllocator& alloc, ObHJBufMgr* buf_mgr, uint64_t tenant_id, int32_t part_level, int32_t batchno) - : alloc_(alloc), - chunk_row_store_(&alloc), + ObHJBatch(common::ObIAllocator &alloc, ObHJBufMgr *buf_mgr, uint64_t tenant_id, int32_t part_level, int32_t batchno) + : chunk_row_store_(&alloc), inner_callback_(nullptr), part_level_(part_level), batchno_(batchno), is_chunk_iter_(false), buf_mgr_(buf_mgr), tenant_id_(tenant_id), - timeout_ms_(1000000), n_get_rows_(0), n_add_rows_(0), pre_total_size_(0), @@ -159,8 +157,6 @@ public: } private: - const int64_t ROW_CNT_PER = 0x3FF; - common::ObIAllocator& alloc_; sql::ObChunkRowStore chunk_row_store_; sql::ObChunkRowStore::RowIterator row_store_iter_; sql::ObChunkRowStore::ChunkIterator chunk_iter_; @@ -170,7 +166,6 @@ private: bool is_chunk_iter_; ObHJBufMgr* buf_mgr_; uint64_t tenant_id_; - int64_t timeout_ms_; int64_t n_get_rows_; int64_t n_add_rows_; diff --git a/src/sql/engine/join/ob_hj_buf_mgr.h b/src/sql/engine/join/ob_hj_buf_mgr.h index d594d910a..ca09c5c8a 100644 --- a/src/sql/engine/join/ob_hj_buf_mgr.h +++ b/src/sql/engine/join/ob_hj_buf_mgr.h @@ -22,23 +22,13 @@ namespace join { class ObHJBufMgr : public ObSqlMemoryCallback { public: - ObHJBufMgr() - : reserve_memory_size_(0), - pre_total_alloc_size_(0), - total_alloc_size_(0), - total_left_alloc_size_(0), - page_size_(-1), - dumped_size_(0) + ObHJBufMgr() : + reserve_memory_size_(0), pre_total_alloc_size_(0), total_alloc_size_(0), + page_size_(-1), dumped_size_(0) {} - inline void set_page_size(int64_t page_size) - { - page_size_ = page_size; - } - inline int64_t get_page_size() - { - return page_size_; - } + inline void set_page_size(int64_t page_size) { page_size_ = page_size; } + inline int64_t get_page_size() { return page_size_; } void set_reserve_memory_size(int64_t reserve_memory_size) { @@ -86,8 +76,6 @@ public: return reserve_memory_size_ < page_size_ + total_alloc_size_; } - // OB_INLINE void finish_left_dump() { total_left_alloc_size_ = total_alloc_size_; } - OB_INLINE bool need_dump() { return reserve_memory_size_ * RATIO / 100 < total_alloc_size_; @@ -98,7 +86,6 @@ private: int64_t reserve_memory_size_; int64_t pre_total_alloc_size_; int64_t total_alloc_size_; - int64_t total_left_alloc_size_; int64_t page_size_; int64_t dumped_size_; }; diff --git a/src/sql/engine/ob_physical_plan_ctx.h b/src/sql/engine/ob_physical_plan_ctx.h index 4fcf3dd0b..acd3cc7d7 100644 --- a/src/sql/engine/ob_physical_plan_ctx.h +++ b/src/sql/engine/ob_physical_plan_ctx.h @@ -30,7 +30,7 @@ class ObSQLSessionInfo; class ObPhysicalPlan; class ObExecContext; class ObUdfCtxMgr; -class ObPxDmlRowInfo; +struct ObPxDmlRowInfo; struct PartParamIdxArray { PartParamIdxArray() : part_id_(-1), part_param_idxs_() diff --git a/src/sql/engine/px/exchange/ob_px_receive_op.cpp b/src/sql/engine/px/exchange/ob_px_receive_op.cpp index d95944653..e55978867 100644 --- a/src/sql/engine/px/exchange/ob_px_receive_op.cpp +++ b/src/sql/engine/px/exchange/ob_px_receive_op.cpp @@ -254,9 +254,6 @@ int ObPxReceiveOp::rescan() int ObPxReceiveOp::drain_exch() { int ret = OB_SUCCESS; - int tmp_ret = OB_SUCCESS; - const ObNewRow* row = NULL; - ObPxReceiveOpInput* recv_input = NULL; uint64_t version = -1; if (OB_FAIL(try_open())) { LOG_WARN("get operator ctx failed", K(ret)); @@ -296,7 +293,6 @@ int ObPxReceiveOp::drain_exch() int ObPxReceiveOp::active_all_receive_channel() { int ret = OB_SUCCESS; - const int batch = 10; while (!dfc_.is_all_channel_act() && OB_SUCC(ret)) { if (OB_FAIL(inner_get_next_row())) { if (OB_ITER_END != ret) { diff --git a/src/sql/engine/px/exchange/ob_px_transmit_op.cpp b/src/sql/engine/px/exchange/ob_px_transmit_op.cpp index 6f677bf31..c6172912c 100644 --- a/src/sql/engine/px/exchange/ob_px_transmit_op.cpp +++ b/src/sql/engine/px/exchange/ob_px_transmit_op.cpp @@ -61,8 +61,7 @@ int ObPxTransmitOpInput::get_parent_dfo_key(ObDtlDfoKey& key) int ObPxTransmitOpInput::get_data_ch(ObPxTaskChSet& task_ch_set, int64_t timeout_ts, ObDtlChTotalInfo*& ch_info) { int ret = OB_SUCCESS; - int64_t task_id = OB_INVALID_ID; - ObPxSQCProxy* ch_provider = reinterpret_cast(ch_provider_ptr_); + ObPxSQCProxy* ch_provider = reinterpret_cast(ch_provider_ptr_); if (OB_ISNULL(ch_provider)) { ret = OB_NOT_INIT; LOG_WARN("ch provider not init", K(ret)); @@ -341,7 +340,6 @@ int ObPxTransmitOp::send_eof_row() int ret = OB_SUCCESS; ObPhysicalPlanCtx* phy_plan_ctx = GET_PHY_PLAN_CTX(ctx_); LOG_TRACE("Send eof row", "op_id", get_spec().id_, "ch_cnt", task_channels_.count(), K(ret)); - int64_t max_loop = 0; if (OB_ISNULL(ch_info_) || ch_info_->receive_exec_server_.total_task_cnt_ != task_channels_.count()) { ret = OB_ERR_UNEXPECTED; LOG_WARN("unexpected status: ch info is null", K(ret), KP(ch_info_), K(task_channels_.count())); diff --git a/src/sql/engine/px/ob_px_data_ch_provider.cpp b/src/sql/engine/px/ob_px_data_ch_provider.cpp index 9b36de980..527047aa0 100644 --- a/src/sql/engine/px/ob_px_data_ch_provider.cpp +++ b/src/sql/engine/px/ob_px_data_ch_provider.cpp @@ -80,7 +80,6 @@ int ObPxChProviderUtil::inner_get_data_ch(bool ch_map_opt, ObPxTaskChSets& ch_se // transmit get channel // M: transmit task count // N: receive task count - uint64_t chid = 0; if (is_transmit) { // transmit if (OB_FAIL(ObDtlChannelUtil::get_transmit_dtl_channel_set(sqc_id, task_id, ch_total_info, ch_set))) { diff --git a/src/sql/resolver/dml/ob_group_by_checker.cpp b/src/sql/resolver/dml/ob_group_by_checker.cpp index d6920a758..2f41a3b23 100644 --- a/src/sql/resolver/dml/ob_group_by_checker.cpp +++ b/src/sql/resolver/dml/ob_group_by_checker.cpp @@ -451,7 +451,7 @@ int ObGroupByChecker::visit(ObConstRawExpr& expr) if (find_in_rollup(expr) || find_in_grouping_sets(expr)) { set_skip_expr(&expr); } - return OB_SUCCESS; + return ret; } int ObGroupByChecker::visit(ObVarRawExpr& expr)