Skip to content

Commit

Permalink
fix conditional that breaks limit (#78)
Browse files Browse the repository at this point in the history
## What is the goal of this PR?
A bug filed previously typedb/typedb#5388 shows that `limit` is not applied to `match...delete` queries. An investigation showed that filters were not even leaving the Graql parser and becoming part of the parsed Graql objects.

## What are the changes implemented in this PR?
* Flip the incorrect conditional in in `visitQuery__delete` so that filters are included instead of ignored, if they exist!
  • Loading branch information
flyingsilverfin authored and haikalpribadi committed Sep 5, 2019
1 parent 604a27e commit fe9c63e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion java/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public GraqlDelete visitQuery_delete(GraqlParser.Query_deleteContext ctx) {
.stream().map(this::visitPattern)
.collect(Collectors.toCollection(LinkedHashSet::new)));

if (ctx.filters().getChildCount() > 0) {
if (ctx.filters().getChildCount() == 0) {
return new GraqlDelete(match, vars);
} else {
Triple<Filterable.Sorting, Long, Long> filters = visitFilters(ctx.filters());
Expand Down

0 comments on commit fe9c63e

Please sign in to comment.