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

Fix for issue #8108: Random() in lambda #9353

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

maiadegraaf
Copy link
Contributor

This PR fixes the bug found in issue #8108.

When the random() function was called like in the example below, it was incorrectly set to foldable, making the result a constant so both rows contained the same value. Now the BoundFunctionExpression::IsFoldable() function also checks the bound lambda expression for side effects, creating two different random values.

select [random() for _ in range(1)]  from range(2);

Copy link
Contributor

@taniabogatsch taniabogatsch left a comment

Choose a reason for hiding this comment

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

Thanks for the PR; it looks good!

@Mytherin Mytherin merged commit af29e34 into duckdb:feature Oct 16, 2023
43 checks passed
@maiadegraaf maiadegraaf deleted the list_random_lambda branch February 23, 2024 09:07
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