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

Panic in Row::try_get #1072

Open
conradludgate opened this issue Oct 19, 2023 · 1 comment
Open

Panic in Row::try_get #1072

conradludgate opened this issue Oct 19, 2023 · 1 comment

Comments

@conradludgate
Copy link

I don't have a good explanation for what happened, but I see a panic in our production environment from the prepared statement code.

index out of bounds: the len is 1 but the index is 1

This panic comes from

let range = self.ranges[idx].to_owned()?;
which in turn came from
let type_: i8 = row.try_get(1)?;

For some reason, the typeinfo query returned a row data entry with only a single item in it. I haven't yet searched any further to understand how this could possibly happen, but it did so I am reporting it. I plan to fix this in our fork by replacing ranges[idx] with ranges.get(idx)? but maybe there's a better solution (erroring on Row::new)?

@sfackler
Copy link
Owner

Very weird! Yeah, I think I'd prefer checking up front in Row::new.

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

No branches or pull requests

2 participants