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

Fixed a potential panic in SQLite row iterators #4115

Conversation

weiznich
Copy link
Member

This commit fixes a potential panic in sqlite row iterator if the first iteration step returns an error. We return now a None value there instead of panicing as the iterator "ends" at that point.

This commit fixes a potential panic in sqlite row iterator if the first
iteration step returns an error. We return now a `None` value there
instead of panicing as the iterator "ends" at that point.
@weiznich weiznich added the maybe backport Maybe backport this pr to the latest diesel release label Jul 12, 2024
@weiznich weiznich requested a review from a team July 12, 2024 09:56
weiznich added a commit to WattSense/diesel_async that referenced this pull request Jul 12, 2024
See diesel-rs/diesel#4115 for a fix of the
underlying issue in diesel itself
Copy link

@kw217 kw217 left a comment

Choose a reason for hiding this comment

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

LGTM.

// we likely got an error while executing the other
// `NotStarted` branch above. In this case we just want to stop
// iterating here
None
Copy link

Choose a reason for hiding this comment

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

This seems reasonable to me. Either we've already returned some error or we've already returned None. In either case, returning None forever after is good.

@weiznich weiznich added this pull request to the merge queue Jul 12, 2024
Merged via the queue into diesel-rs:master with commit 850604b Jul 12, 2024
50 checks passed
weiznich added a commit to weiznich/diesel that referenced this pull request Jul 16, 2024
…houldn_t_panic_if_called_again_after_error

Fixed a potential panic in SQLite row iterators
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maybe backport Maybe backport this pr to the latest diesel release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants