Fix unexpected memory access of window function

This commit is contained in:
Zach41
2024-06-26 05:58:35 +00:00
committed by ob-robot
parent b009d6029e
commit 2d4b0fdc52
3 changed files with 18 additions and 2 deletions

View File

@ -3741,6 +3741,7 @@ int ObWindowFunctionVecSpec::rd_generate_patch(RDWinFuncPXPieceMsgCtx &msg_ctx,
// but expr data are filled with datums, unexpected errors will happen.
for (int i = 0; OB_SUCC(ret) && i < rd_coord_exprs_.count(); i++) {
VectorFormat default_fmt = rd_coord_exprs_.at(i)->get_default_res_format();
// TODO: @zongmei.zzm support batch_size < 4 for range distribution
if (OB_FAIL(rd_coord_exprs_.at(i)->init_vector_for_write(
eval_ctx, rd_coord_exprs_.at(i)->is_const_expr() ? VEC_UNIFORM_CONST : VEC_UNIFORM, 4))) {
LOG_WARN("init vector failed", K(ret));

View File

@ -40,6 +40,8 @@ class RDWinFuncPXPartialInfo;
class ObWindowFunctionVecSpec: public ObWindowFunctionSpec
{
OB_UNIS_VERSION_V(1);
public:
static const int64_t RD_MIN_BATCH_SIZE = 4;
public:
ObWindowFunctionVecSpec(common::ObIAllocator &alloc, const ObPhyOperatorType type) :
ObWindowFunctionSpec(alloc, type)