Fix section code REVERSE_ INULL, DIVIDE_ BY_ ZERO's problem

This commit is contained in:
obdev
2024-01-10 10:30:07 +00:00
committed by ob-robot
parent 104a9f60d0
commit db305bcbc0
3 changed files with 35 additions and 24 deletions

View File

@ -321,13 +321,14 @@ int ObDtlVectors::init(const common::ObIArray<ObExpr*> &exprs, ObEvalCtx &ctx)
} }
} }
if (OB_SUCC(ret) && *col_cnt_ > 0) { if (OB_SUCC(ret) && *col_cnt_ > 0) {
if (row_size != 0){
row_size_ = row_size; row_size_ = row_size;
row_limit_ = remain_size / row_size; row_limit_ = remain_size / row_size;
if (row_size * row_limit_ + *col_cnt_ * ObBitVector::memory_size(row_limit_) > remain_size) { if (row_size * row_limit_ + *col_cnt_ * ObBitVector::memory_size(row_limit_) > remain_size) {
row_limit_ = (remain_size - *col_cnt_ * ObBitVector::memory_size(row_limit_)) / row_size; row_limit_ = (remain_size - *col_cnt_ * ObBitVector::memory_size(row_limit_)) / row_size;
} }
if (row_limit_ <= 0) { if (row_limit_ <= 0) {
ret =OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("failed to calc max row cnt", K(remain_size), K(row_size), K(ret)); LOG_WARN("failed to calc max row cnt", K(remain_size), K(row_size), K(ret));
} else { } else {
for (int64_t i = 0; i < exprs.count(); ++i) { for (int64_t i = 0; i < exprs.count(); ++i) {
@ -340,6 +341,10 @@ int ObDtlVectors::init(const common::ObIArray<ObExpr*> &exprs, ObEvalCtx &ctx)
pos += row_limit_ * info.fixed_len_; pos += row_limit_ * info.fixed_len_;
} }
} }
} else {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected row_size", K(row_size), K(ret));
}
} }
} }
} }

View File

@ -633,10 +633,8 @@ void ObChunkDatumStore::reset()
if (nullptr != callback_) { if (nullptr != callback_) {
callback_->free(item->get_buffer()->mem_size()); callback_->free(item->get_buffer()->mem_size());
} }
if (NULL != item) {
allocator_->free(item); allocator_->free(item);
} }
}
if (NULL != batch_ctx_) { if (NULL != batch_ctx_) {
allocator_->free(batch_ctx_); allocator_->free(batch_ctx_);

View File

@ -607,14 +607,18 @@ void ObHashJoinOp::part_rescan()
for (int64_t i = 0; i < part_count_; i ++) { for (int64_t i = 0; i < part_count_; i ++) {
hj_part_array_[i].~ObHashJoinPartition(); hj_part_array_[i].~ObHashJoinPartition();
} }
if (OB_NOT_NULL(alloc_)) {
alloc_->free(hj_part_array_); alloc_->free(hj_part_array_);
}
hj_part_array_ = NULL; hj_part_array_ = NULL;
} }
if (right_hj_part_array_ != NULL) { if (right_hj_part_array_ != NULL) {
for (int64_t i = 0; i < part_count_; i ++) { for (int64_t i = 0; i < part_count_; i ++) {
right_hj_part_array_[i].~ObHashJoinPartition(); right_hj_part_array_[i].~ObHashJoinPartition();
} }
if (OB_NOT_NULL(alloc_)) {
alloc_->free(right_hj_part_array_); alloc_->free(right_hj_part_array_);
}
right_hj_part_array_ = NULL; right_hj_part_array_ = NULL;
} }
int64_t tmp_part_count = 0 < level2_part_count_ ? int64_t tmp_part_count = 0 < level2_part_count_ ?
@ -624,11 +628,15 @@ void ObHashJoinOp::part_rescan()
for (int64_t i = 0; i < tmp_part_count; i ++) { for (int64_t i = 0; i < tmp_part_count; i ++) {
part_histograms_[i].~HashJoinHistogram(); part_histograms_[i].~HashJoinHistogram();
} }
if (OB_NOT_NULL(alloc_)) {
alloc_->free(part_histograms_); alloc_->free(part_histograms_);
}
part_histograms_ = NULL; part_histograms_ = NULL;
} }
if (OB_NOT_NULL(part_selectors_)) { if (OB_NOT_NULL(part_selectors_)) {
if (OB_NOT_NULL(alloc_)) {
alloc_->free(part_selectors_); alloc_->free(part_selectors_);
}
part_selectors_ = nullptr; part_selectors_ = nullptr;
part_selector_sizes_ = nullptr; part_selector_sizes_ = nullptr;
} }