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 panic in TryFindUnderlyingTypeScanPlan #1919

Merged
merged 1 commit into from Feb 26, 2024

Conversation

kudavid
Copy link
Contributor

@kudavid kudavid commented Feb 25, 2024

TryFindUnderlyingTypeScanPlan panics when trying to scan into a slice of renamed uint8

m := pgtype.NewMap()
var ruint8 []_uint8
err := m.Scan(pgtype.Int2ArrayOID, pgx.TextFormatCode, []byte("{2,4}"), &ruint8)

I get
panic: reflect.Value.Convert: value of type *[]pgtype_test._uint8 cannot be converted to type *[]uint8

@kudavid kudavid force-pushed the fix-underlying-type branch 2 times, most recently from 7d57ca2 to 4165302 Compare February 25, 2024 15:55
Check if CanConvert before calling reflect.Value.Convert
@jackc jackc merged commit d149d3f into jackc:master Feb 26, 2024
14 checks passed
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.

None yet

2 participants