Skip to content

Commit

Permalink
Fix extract filter. (#4823)
Browse files Browse the repository at this point in the history
* Fix extract filter.

* Fail directly.

* Revert "Fail directly."

This reverts commit 671f729.

Co-authored-by: Sophie <[email protected]>
Co-authored-by: kyle.cao <[email protected]>
  • Loading branch information
3 people authored Nov 18, 2022
1 parent afaf442 commit 3e2d7b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/graph/visitor/ExtractFilterExprVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ bool ExtractFilterExprVisitor::visitLogicalOr(LogicalExpression *expr) {
if (canNotPushedIndex != -1 || !canBeSplit) {
return false;
}
canBePushed_ = true; // reset when the LogicalAnd can be split
canNotPushedIndex = i;
flags = std::move(flag);
}
Expand Down
17 changes: 17 additions & 0 deletions tests/tck/features/bugfix/ExtractFilter.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2022 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
Feature: Test extract filter

Background:
Given a graph with space named "nba"

Scenario: Extract filter bug
When executing query:
"""
MATCH (v:player{name: 'Tim Duncan'})-[:like]->(t) WHERE ( (1 == 1 AND (NOT is_edge(t))) OR (v.player.name == 'Tim Duncan')) RETURN v.player.name
"""
Then the result should be, in any order:
| v.player.name |
| 'Tim Duncan' |
| 'Tim Duncan' |

0 comments on commit 3e2d7b2

Please sign in to comment.