Skip to content

Commit e860a25

Browse files
committed
Update tck tests
1 parent 783cfda commit e860a25

File tree

4 files changed

+525
-47
lines changed

4 files changed

+525
-47
lines changed

src/graph/executor/query/IndexScanExecutor.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ folly::Future<Status> IndexScanExecutor::indexScan() {
3030
auto filterStr = lookup->queryContext().front().get_filter();
3131
Expression *filter = Expression::decode(qctx()->objPool(), filterStr);
3232
if (filter->kind() != Expression::Kind::kRelEQ && filter->kind() != Expression::Kind::kRelIn) {
33-
return Status::Error("The kind of filter expression is invalid.");
33+
return Status::Error("The kind of filter expression is invalid: %s",
34+
filter->toString().c_str());
3435
}
3536
auto relFilter = static_cast<const RelationalExpression *>(filter);
36-
if (relFilter->right()->kind() != Expression::Kind::kLabel) {
37-
return Status::Error("The kind of expression is not label expression.");
37+
auto right = DCHECK_NOTNULL(relFilter->right());
38+
if (right->kind() != Expression::Kind::kLabel) {
39+
return Status::Error("The kind of expression is not label expression: %s",
40+
right->toString().c_str());
3841
}
39-
const auto &colName = static_cast<const LabelExpression *>(relFilter->right())->name();
42+
const auto &colName = static_cast<const LabelExpression *>(right)->name();
4043
const auto &result = ectx_->getResult(lookup->inputVar());
4144
std::vector<Expression *> ops;
4245
std::unordered_set<Value> unique;

src/graph/planner/PlannersRegister.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include "graph/planner/match/PropIndexSeek.h"
1414
#include "graph/planner/match/ScanSeek.h"
1515
#include "graph/planner/match/StartVidFinder.h"
16-
#include "graph/planner/match/VariableVertexIdSeek.h"
1716
#include "graph/planner/match/VariablePropIndexSeek.h"
17+
#include "graph/planner/match/VariableVertexIdSeek.h"
1818
#include "graph/planner/match/VertexIdSeek.h"
1919
#include "graph/planner/ngql/FetchEdgesPlanner.h"
2020
#include "graph/planner/ngql/FetchVerticesPlanner.h"

src/graph/util/OptimizerUtils.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ Status OptimizerUtils::createIndexQueryCtx(Expression* filter,
914914
if (!filter) {
915915
// Only filter is nullptr when lookup on tagname
916916
// Degenerate back to tag lookup
917-
NG_RETURN_IF_ERROR(createIndexQueryCtx(iqctx, qctx, node));
917+
return createIndexQueryCtx(iqctx, qctx, node);
918918
}
919919

920920
// items used for optimal index fetch and index scan context optimize.
@@ -926,7 +926,11 @@ Status OptimizerUtils::createIndexQueryCtx(Expression* filter,
926926
// TODO: refactor index selector logic to avoid this rewriting
927927
auto* newFilter = ExpressionUtils::rewriteParameter(filter, qctx);
928928
NG_RETURN_IF_ERROR(analyzeExpression(newFilter, &items, &kind, node->isEdge(), qctx));
929-
return createIndexQueryCtx(iqctx, kind, items, qctx, node);
929+
auto status = createIndexQueryCtx(iqctx, kind, items, qctx, node);
930+
if (!status.ok()) {
931+
return createIndexQueryCtx(iqctx, qctx, node);
932+
}
933+
return Status::OK();
930934
}
931935

932936
Status OptimizerUtils::createIndexQueryCtx(std::vector<IndexQueryContext>& iqctx,

0 commit comments

Comments
 (0)