From 2f73bde88e04b8cb6c4ab7fff54ed57dad558037 Mon Sep 17 00:00:00 2001 From: Shylock Hg <33566796+Shylock-Hg@users.noreply.github.com> Date: Thu, 19 May 2022 09:58:25 +0800 Subject: [PATCH 1/2] Fix sharing filter expression inter threads. --- src/storage/query/GetPropProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/storage/query/GetPropProcessor.cpp b/src/storage/query/GetPropProcessor.cpp index 046f25052fe..cba9cf05876 100644 --- a/src/storage/query/GetPropProcessor.cpp +++ b/src/storage/query/GetPropProcessor.cpp @@ -202,7 +202,7 @@ StoragePlan GetPropProcessor::buildTagPlan(RuntimeContext* context, tags.emplace_back(tag.get()); plan.addNode(std::move(tag)); } - auto output = std::make_unique(context, tags, result, filter_, limit_); + auto output = std::make_unique(context, tags, result, filter_->clone(), limit_); for (auto* tag : tags) { output->addDependency(tag); } @@ -219,7 +219,7 @@ StoragePlan GetPropProcessor::buildEdgePlan(RuntimeContext* conte edges.emplace_back(edge.get()); plan.addNode(std::move(edge)); } - auto output = std::make_unique(context, edges, result, filter_, limit_); + auto output = std::make_unique(context, edges, result, filter_->clone(), limit_); for (auto* edge : edges) { output->addDependency(edge); } From a6279e85c0fa03c4f0e90228d733e6089ec36d50 Mon Sep 17 00:00:00 2001 From: Shylock Hg <33566796+Shylock-Hg@users.noreply.github.com> Date: Thu, 19 May 2022 10:38:32 +0800 Subject: [PATCH 2/2] Avoid deref null filter. --- src/storage/query/GetPropProcessor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/query/GetPropProcessor.cpp b/src/storage/query/GetPropProcessor.cpp index cba9cf05876..f4c2412a073 100644 --- a/src/storage/query/GetPropProcessor.cpp +++ b/src/storage/query/GetPropProcessor.cpp @@ -202,7 +202,8 @@ StoragePlan GetPropProcessor::buildTagPlan(RuntimeContext* context, tags.emplace_back(tag.get()); plan.addNode(std::move(tag)); } - auto output = std::make_unique(context, tags, result, filter_->clone(), limit_); + auto output = std::make_unique( + context, tags, result, filter_ == nullptr ? nullptr : filter_->clone(), limit_); for (auto* tag : tags) { output->addDependency(tag); } @@ -219,7 +220,8 @@ StoragePlan GetPropProcessor::buildEdgePlan(RuntimeContext* conte edges.emplace_back(edge.get()); plan.addNode(std::move(edge)); } - auto output = std::make_unique(context, edges, result, filter_->clone(), limit_); + auto output = std::make_unique( + context, edges, result, filter_ == nullptr ? nullptr : filter_->clone(), limit_); for (auto* edge : edges) { output->addDependency(edge); }