[exceptionsafe](expr) exprcontext's open and prepare method should catch exception (#22230)

Co-authored-by: yiguolei <yiguolei@gmail.com>ExprContext may throw exception during expr->open, and it will core in non-pipeline mode.
This commit is contained in:
yiguolei
2023-07-26 14:46:24 +08:00
committed by GitHub
parent 9f3960b460
commit 6c0c66e664

View File

@ -67,7 +67,9 @@ doris::Status VExprContext::execute(doris::vectorized::Block* block, int* result
doris::Status VExprContext::prepare(doris::RuntimeState* state,
const doris::RowDescriptor& row_desc) {
_prepared = true;
return _root->prepare(state, row_desc, this);
Status st;
RETURN_IF_CATCH_EXCEPTION({ st = _root->prepare(state, row_desc, this); });
return st;
}
doris::Status VExprContext::open(doris::RuntimeState* state) {
@ -80,7 +82,9 @@ doris::Status VExprContext::open(doris::RuntimeState* state) {
// original's fragment state and only need to have thread-local state initialized.
FunctionContext::FunctionStateScope scope =
_is_clone ? FunctionContext::THREAD_LOCAL : FunctionContext::FRAGMENT_LOCAL;
return _root->open(state, this, scope);
Status st;
RETURN_IF_CATCH_EXCEPTION({ st = _root->open(state, this, scope); });
return st;
}
void VExprContext::close() {