-
Notifications
You must be signed in to change notification settings - Fork 168
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
RCORE-2221 test to prove between node wrong behaviour over links #7940
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6559,4 +6559,29 @@ TEST(Parser_Wildcard) | |
CHECK_EQUAL(q.count(), 1); | ||
} | ||
|
||
TEST(Test_Between_OverLinks) | ||
{ | ||
Group g; | ||
TableRef parent = g.add_table("Parent"); | ||
TableRef child = g.add_table("Child"); | ||
|
||
ColKey ck_child = parent->add_column(*child, "child"); | ||
ColKey ck_int = child->add_column(type_Int, "int"); | ||
|
||
for (size_t i = 0; i < 100; ++i) { | ||
auto obj = child->create_object(); | ||
obj.set(ck_int, (int)i); | ||
parent->create_object().set(ck_child, obj.get_key()); | ||
} | ||
|
||
// this works is using a RelationalNode | ||
auto q = parent->query("child.int < 50"); | ||
CHECK(q.count() == 50); | ||
|
||
// this uses the new in between node and verifies that the link is followed. | ||
auto q1 = parent->query("child.int BETWEEN {0,100}"); | ||
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. Apparently we are not following the links, when we do:
|
||
CHECK(q1.count() == 100); | ||
} | ||
|
||
|
||
#endif // TEST_PARSER |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I am not sure if this is enough, and it is covering all the cases, but it seems like it is enough to pass all core tests, we basically need to use the target table if the query is run over links. @ironage @jedelbo
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.
This approach doesn't work because you are passing the destination column and the destination table, without accounting for the links along the way. The specialized between node doesn't handle links, so we can just fall back to a normal relational comparison below. I have opened #7965 to do it this way.
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 great! Probably we should have a test in core that tracks this, because if something is not working, some test should tell us!!! But again, thanks for spotting this.
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.
There is a test in #7965 which will catch this.