fix: increase expr recursion depth to avoid parse failed (#29860)

#29759

Signed-off-by: luzhang <luzhang@zilliz.com>
Co-authored-by: luzhang <luzhang@zilliz.com>
This commit is contained in:
zhagnlu 2024-01-11 10:26:50 +08:00 committed by GitHub
parent 031243fee7
commit 5164d30287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,15 @@ CreateRetrievePlanByExpr(const Schema& schema,
const void* serialized_expr_plan,
const int64_t size) {
proto::plan::PlanNode plan_node;
plan_node.ParseFromArray(serialized_expr_plan, size);
google::protobuf::io::ArrayInputStream array_stream(serialized_expr_plan,
size);
google::protobuf::io::CodedInputStream input_stream(&array_stream);
input_stream.SetRecursionLimit(std::numeric_limits<int32_t>::max());
auto res = plan_node.ParsePartialFromCodedStream(&input_stream);
if (!res) {
throw SegcoreError(UnexpectedError, "parse plan node proto failed");
}
return ProtoParser(schema).CreateRetrievePlan(plan_node);
}