[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:
yiguolei
2023-12-09 00:18:14 +08:00
committed by GitHub
parent 8eed760704
commit abc802b5ba
10 changed files with 48 additions and 45 deletions

View File

@ -33,12 +33,11 @@ OPERATOR_CODE_GENERATOR(TableFunctionOperator, StatefulOperator)
Status TableFunctionOperator::prepare(doris::RuntimeState* state) {
// just for speed up, the way is dangerous
_child_block.reset(_node->get_child_block());
_child_block = _node->get_child_block();
return StatefulOperator::prepare(state);
}
Status TableFunctionOperator::close(doris::RuntimeState* state) {
_child_block.release();
return StatefulOperator::close(state);
}