Skip to content

Commit

Permalink
Fix some memory error (#3544)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>
  • Loading branch information
Shylock-Hg and Sophie-Xie authored Dec 25, 2021
1 parent 3fbfd82 commit 62d6bf7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ StatusOr<OptRule::TransformResult> PushFilterDownScanVerticesRule::transform(
auto sv = static_cast<const ScanVertices *>(svGroupNode->node());
auto qctx = ctx->qctx();
auto pool = qctx->objPool();
auto condition = filter->condition()->clone();
auto condition = DCHECK_NOTNULL(filter->condition())->clone();

auto visitor = graph::ExtractFilterExprVisitor::makePushGetVertices(pool);
condition->accept(&visitor);
Expand Down
7 changes: 5 additions & 2 deletions src/graph/planner/match/ScanSeek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ StatusOr<SubPlan> ScanSeek::transformNode(NodeContext *nodeCtx) {
prev = notEmpty;
}
}
auto *filter = Filter::make(qctx, scanVertices, prev);
plan.root = filter;
if (prev != nullptr) {
// prev equals to nullptr happend when there are no tags in whole space
auto *filter = Filter::make(qctx, scanVertices, prev);
plan.root = filter;
}

nodeCtx->initialExpr = InputPropertyExpression::make(pool, kVid);
return plan;
Expand Down
2 changes: 1 addition & 1 deletion src/graph/session/ClientSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ClientSession final {
}
}

const meta::cpp2::Session& getSession() const {
meta::cpp2::Session getSession() const {
folly::RWSpinLock::ReadHolder rHolder(rwSpinLock_);
return session_;
}
Expand Down
5 changes: 4 additions & 1 deletion src/parser/parser.yy
Original file line number Diff line number Diff line change
Expand Up @@ -1382,9 +1382,12 @@ vid
$$ = ConstantExpression::make(qctx->objPool(), *$1);
delete $1;
}
// This reduce rule aim to report more friendly error message
| VARIABLE {
$$ = nullptr;
delete($1);
SCOPE_EXIT {
delete($1);
};
if (qctx->existParameter(*$1)) {
throw nebula::GraphParser::syntax_error(@1, "Parameter is not supported in vid");
} else {
Expand Down

0 comments on commit 62d6bf7

Please sign in to comment.