diff --git a/src/graph/optimizer/rule/PushFilterDownScanVerticesRule.cpp b/src/graph/optimizer/rule/PushFilterDownScanVerticesRule.cpp index 00ed8a00711..6bc600c9440 100644 --- a/src/graph/optimizer/rule/PushFilterDownScanVerticesRule.cpp +++ b/src/graph/optimizer/rule/PushFilterDownScanVerticesRule.cpp @@ -43,7 +43,7 @@ StatusOr PushFilterDownScanVerticesRule::transform( auto sv = static_cast(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); diff --git a/src/graph/planner/match/ScanSeek.cpp b/src/graph/planner/match/ScanSeek.cpp index 40ee85dc015..8b08a157858 100644 --- a/src/graph/planner/match/ScanSeek.cpp +++ b/src/graph/planner/match/ScanSeek.cpp @@ -92,8 +92,11 @@ StatusOr 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; diff --git a/src/graph/session/ClientSession.h b/src/graph/session/ClientSession.h index 2568a07c01d..9001da52fd9 100644 --- a/src/graph/session/ClientSession.h +++ b/src/graph/session/ClientSession.h @@ -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_; } diff --git a/src/parser/parser.yy b/src/parser/parser.yy index 013c238d3d4..373f1fd9a25 100644 --- a/src/parser/parser.yy +++ b/src/parser/parser.yy @@ -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 {