-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix mismatched exception type of unique index query #797
Conversation
Change-Id: I9977a4cc05e3ee30d869ea32a043eddce216fa22 fixed: #795
Codecov Report
@@ Coverage Diff @@
## master #797 +/- ##
===========================================
+ Coverage 71.13% 71.74% +0.6%
- Complexity 4331 4380 +49
===========================================
Files 283 283
Lines 20957 20967 +10
Branches 2957 2959 +2
===========================================
+ Hits 14908 15043 +135
+ Misses 4568 4443 -125
Partials 1481 1481
Continue to review full report at Codecov.
|
@@ -592,7 +592,11 @@ private MatchedIndex collectMatchedIndex(SchemaLabel schemaLabel, | |||
SchemaTransaction schema = this.graph().schemaTransaction(); | |||
Set<IndexLabel> ils = InsertionOrderUtil.newSet(); | |||
for (Id il : schemaLabel.indexLabels()) { | |||
ils.add(schema.getIndexLabel(il)); | |||
IndexLabel indexLabel = schema.getIndexLabel(il); | |||
if (indexLabel.indexType().isUniuqe()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isUniuqe => isUnique
ils.add(schema.getIndexLabel(il)); | ||
IndexLabel indexLabel = schema.getIndexLabel(il); | ||
if (indexLabel.indexType().isUniuqe()) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not allowed to query by unique index
Assert.assertThrows(NoIndexException.class, () -> { | ||
graph.traversal().V().hasLabel("node").has("name", "tom").next(); | ||
}, (e) -> { | ||
Assert.assertTrue(e.getMessage().equals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertEquals
Assert.assertThrows(NoIndexException.class, () -> { | ||
graph().traversal().E().hasLabel("like").has("weight", 0.5).next(); | ||
}, (e) -> { | ||
Assert.assertTrue(e.getMessage().equals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertEquals
Change-Id: Iba850b598f05a652c10659efa251fb8a7bdf20a3
Change-Id: Id1f469218e6d537b221f6d930fdd0bc9dc344c85
@@ -3588,7 +3588,6 @@ public void testRemoveVertexOfNotExists() { | |||
graph.tx().commit(); | |||
} | |||
|
|||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments why fail
Change-Id: Iaddf6e070a083002b8b17e238384cdd2f7e43a1e
fixed: #795
Change-Id: I9977a4cc05e3ee30d869ea32a043eddce216fa22