Skip to content
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

Bug: When executing the EqualsExpression after an update it returns wrong results #395

Closed
wants to merge 1 commit into from
Closed

Conversation

torpedro
Copy link
Contributor

@torpedro torpedro commented Dec 4, 2014

Added a test for this. This test fails in the current state.
I assume for this test to pass the EqualsExpression needs to be fixed.

// Bug-Note: Using the GenericExpressionValue works fine
// Bug-Note: Using the EqualsExpression returns wrong results
// sts2.setPredicate(new GenericExpressionValue<hyrise_int_t, std::equal_to<hyrise_int_t>>(0, 0, 7));
sts2.setPredicate(new EqualsExpression<hyrise_int_t>(0, "company_id", 7));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line (line 71) causes the bug. Replacing it with line 70 would work.
But the class EqualsExpression is still used/available in the predicate builder of the SimpleTableScan.

@Bensk1
Copy link
Contributor

Bensk1 commented Dec 8, 2014

The error is caused by the way this expression system works. The EqualsExpression checks equality for valueIds where the GenericExpressionValue checks the actual value. The update (line 46 to 50) inserts data into the delta, not the main storage. But the EqualsExpression uses only on the main dictionary to find the valueId and the GenericExpressionValue looks for all plain values in main and delta. The system is not designed to work properly with values in the delta storage. But there is another expression system coming: hyrise/hyrise#320

To fix this, you could just include a merge in the test case:
http://nopaste.linux-dev.org/?374857

@torpedro torpedro closed this Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants