[bugfix](core) child block is shared between operator and node, it should be shared ptr (#28106)
_child_block in nest loop join , table value function, repeat node will be shared between ExecNode and related operator, but it should not be a unique ptr in operator, it belongs to exec node. It will double free the block, if operator's close method is not called correctly. It should be a shared ptr, then it will not core even if the opeartor's close method is not called.
This commit is contained in:
@ -62,7 +62,7 @@ public:
|
||||
return VExpr::open(_vfn_ctxs, state);
|
||||
}
|
||||
Status get_next(RuntimeState* state, Block* block, bool* eos) override;
|
||||
bool need_more_input_data() const { return !_child_block.rows() && !_child_eos; }
|
||||
bool need_more_input_data() const { return !_child_block->rows() && !_child_eos; }
|
||||
|
||||
void release_resource(doris::RuntimeState* state) override {
|
||||
if (_num_rows_filtered_counter != nullptr) {
|
||||
@ -92,7 +92,7 @@ public:
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
Block* get_child_block() { return &_child_block; }
|
||||
std::shared_ptr<Block> get_child_block() { return _child_block; }
|
||||
|
||||
private:
|
||||
Status _prepare_output_slot_ids(const TPlanNode& tnode);
|
||||
@ -135,7 +135,7 @@ private:
|
||||
return;
|
||||
}
|
||||
for (auto index : _output_slot_indexs) {
|
||||
auto src_column = _child_block.get_by_position(index).column;
|
||||
auto src_column = _child_block->get_by_position(index).column;
|
||||
columns[index]->insert_many_from(*src_column, _cur_child_offset,
|
||||
_current_row_insert_times);
|
||||
}
|
||||
@ -143,7 +143,7 @@ private:
|
||||
}
|
||||
int _current_row_insert_times = 0;
|
||||
|
||||
Block _child_block;
|
||||
std::shared_ptr<Block> _child_block;
|
||||
std::vector<SlotDescriptor*> _child_slots;
|
||||
std::vector<SlotDescriptor*> _output_slots;
|
||||
int64_t _cur_child_offset = 0;
|
||||
|
||||
Reference in New Issue
Block a user