Skip to content

Commit

Permalink
fix filter bug (#5720)
Browse files Browse the repository at this point in the history
* fix error

* check error
  • Loading branch information
nevermore3 authored Sep 19, 2023
1 parent e84e236 commit a6c163c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/graph/executor/query/AppendVerticesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ folly::Future<Status> AppendVerticesExecutor::handleRespMultiJobs(
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto &&rows = std::move(res).value();
std::move(rows.begin(), rows.end(), std::back_inserter(result_.rows));
}
Expand Down Expand Up @@ -242,6 +243,7 @@ folly::Future<Status> AppendVerticesExecutor::handleRespMultiJobs(
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto &&rows = std::move(res).value();
std::move(rows.begin(), rows.end(), std::back_inserter(result_.rows));
}
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/FilterExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ folly::Future<Status> FilterExecutor::execute() {
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto &&rows = std::move(res).value();
result.rows.insert(result.rows.end(),
std::make_move_iterator(rows.begin()),
Expand Down
2 changes: 2 additions & 0 deletions src/graph/executor/query/InnerJoinExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ folly::Future<Status> InnerJoinExecutor::probe(const std::vector<Expression*>& p
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto&& rows = std::move(res).value();
result.rows.insert(result.rows.end(),
std::make_move_iterator(rows.begin()),
Expand Down Expand Up @@ -228,6 +229,7 @@ folly::Future<Status> InnerJoinExecutor::singleKeyProbe(Expression* probeKey, It
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto&& rows = std::move(res).value();
result.rows.insert(result.rows.end(),
std::make_move_iterator(rows.begin()),
Expand Down
2 changes: 2 additions & 0 deletions src/graph/executor/query/LeftJoinExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ folly::Future<Status> LeftJoinExecutor::probe(const std::vector<Expression*>& pr
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto&& rows = std::move(res).value();
result.rows.insert(result.rows.end(),
std::make_move_iterator(rows.begin()),
Expand Down Expand Up @@ -204,6 +205,7 @@ folly::Future<Status> LeftJoinExecutor::singleKeyProbe(Expression* probeKey, Ite
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto&& rows = std::move(res).value();
result.rows.insert(result.rows.end(),
std::make_move_iterator(rows.begin()),
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/ProjectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ folly::Future<Status> ProjectExecutor::execute() {
}
}
auto res = std::move(respVal).value();
NG_RETURN_IF_ERROR(res);
auto &&rows = std::move(res).value();
result.rows.insert(result.rows.end(),
std::make_move_iterator(rows.begin()),
Expand Down
7 changes: 7 additions & 0 deletions tests/tck/features/expression/StartsWith.feature
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,10 @@ Feature: Starts With Expression
Then the result should be, in any order:
| $^.player.name | $$.player.name | like.likeness |
| 'Manu Ginobili' | 'Tim Duncan' | 90 |
Scenario: starts with wrong type
When executing query:
"""
MATCH (v:player)-[]->() WHERE v.player.name STARTS WITH 1 RETURN v
"""
Then a ExecutionError should be raised at runtime: Failed to evaluate condition: ($-.v.player.name STARTS WITH 1). For boolean conditions, please write in their full forms like <condition> == <true/false> or <condition> IS [NOT] NULL.

0 comments on commit a6c163c

Please sign in to comment.