-
Notifications
You must be signed in to change notification settings - Fork 594
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(expr): fix SOME/ALL/ANY
expression
#14221
Conversation
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
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.
LGTM, thanks
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'm worrying that the fix will lead to similar compatibility issue like #13890. 😕
Some(num) => self.resolve_bools(func_results_iter.by_ref().take(num)), | ||
Some(num) => { | ||
let range = offset..offset + num; | ||
offset += num; | ||
self.resolve_bools(range.map(|i| bools.value_at(i))) | ||
} |
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.
So the actual bug is that we mistakenly expect resolve_bools
to exhaust the passed-in iterator, right? This is quite subtle. 🤣 Could you please add some comments to elaborate 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.
Yes. I didn't realize the passed-in iterator is actually a reference. This is a bad practice. 🤪
CI found a bug in EOWC. Looks like unrelated to this PR. cc @stdrc
|
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]> Co-authored-by: Runji Wang <[email protected]>
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
fix #14214, which was introduced by #13402.
When short-circuit occurred, the
resolve_bools
function did not consume all items in the input iterator, causing subsequent booleans to be misaligned.Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
Fixes the correctness of SOME/ALL/ANY expressions. The fix introduces a breaking change for versions from v1.5.0 to v1.5.3. It is recommended to drop and recreate any materialized views that contain
SOME/ALL/ANY
expressions.