Skip to content
Snippets Groups Projects
Unverified Commit e70c326d authored by Yichen Wang's avatar Yichen Wang Committed by GitHub
Browse files

Fix seek by negative vid (#932)

* Fix seek by negtive vid

Fix typo

* Fix tck
parent 669252ac
No related branches found
No related tags found
No related merge requests found
......@@ -447,7 +447,7 @@ Status MatchValidator::validateStepRange(const MatchStepRange *range) const {
}
if (min < 0) {
return Status::SemanticError(
"Cannot set negtive steps minumum hop for variable length relationships");
"Cannot set negative steps minumum hop for variable length relationships");
}
return Status::OK();
}
......
......@@ -24,6 +24,9 @@ void FoldConstantExprVisitor::visit(UnaryExpression *expr) {
if (canBeFolded_) {
expr->setOperand(fold(expr->operand()));
}
} else {
canBeFolded_ = expr->kind() == Expression::Kind::kUnaryNegate ||
expr->kind() == Expression::Kind::kUnaryPlus;
}
}
......
......@@ -264,3 +264,46 @@ Feature: Match seek by id
| 'Aron Baynes' |
| 'Blake Griffin' |
| 'Grant Hill' |
Scenario: [v2ga bug] Negative start vid
Given an empty graph
And create a space with following options:
| partition_num | 9 |
| replica_factor | 1 |
| vid_type | int64 |
| charset | utf8 |
| collate | utf8_bin |
And having executed:
"""
CREATE TAG player(name string, age int);
"""
When try to execute query:
"""
INSERT VERTEX player(name, age) VALUES -100:("Tim", 32);
"""
Then the execution should be successful
When executing query:
"""
CREATE TAG INDEX player_name_index ON player(name(10));
"""
Then the execution should be successful
And wait 6 seconds
When submit a job:
"""
REBUILD TAG INDEX player_name_index;
"""
Then wait the job to finish
When executing query:
"""
MATCH (v) WHERE id(v) == -100 RETURN v;
"""
Then the result should be, in any order:
| v |
| (-100 :player{age: 32, name: "Tim"}) |
When executing query:
"""
MATCH (v) WHERE id(v) IN [-100] RETURN v;
"""
Then the result should be, in any order:
| v |
| (-100 :player{age: 32, name: "Tim"}) |
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment