-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 extract filter. #4823
Fix extract filter. #4823
Changes from 2 commits
78c0cc3
e27c9c5
256fd91
671f729
a1054c3
1e77e9e
8302156
c99b2c9
aec368f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,6 +276,7 @@ bool ExtractFilterExprVisitor::visitLogicalOr(LogicalExpression *expr) { | |
if (canNotPushedIndex != -1 || !canBeSplit) { | ||
return false; | ||
} | ||
canBePushed_ = true; // reset when the LogicalAnd can be split | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO, this is not a good fix. Just fixed code path, but it's not a natural code logic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's only what I can do. |
||
canNotPushedIndex = i; | ||
flags = std::move(flag); | ||
} | ||
|
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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to find the crash cases in community edition. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't do that. |
||
| v.player.name | | ||
| 'Tim Duncan' | | ||
| 'Tim Duncan' | |
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.
Crashed at
DCHECK(ok())
in ExprVisitorImpl.cpp:130.Better to fix else branch:
Alternatively, we could do some minor refactoring of this visitor, such as adding additional state variables other than "can" and "cannot" pairs to allow the internal logic to 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.
ok
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.
Will lead to test fail.