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

Scan JSON value get panic #1979

Open
nirsht opened this issue May 24, 2023 · 1 comment
Open

Scan JSON value get panic #1979

nirsht opened this issue May 24, 2023 · 1 comment
Assignees
Labels

Comments

@nirsht
Copy link

nirsht commented May 24, 2023

https://github.com/go-pg/pg/blob/f7e1c98fed3044ae4e195a0e063f69185fb1885b/types/scan_value.go#LL254C2-L254C2
If the JSON value , this line get panic.

Here is the stack trace

/usr/local/go/src/runtime/panic.go:838 +0x207
reflect.flag.mustBeAssignableSlow(0x0?)
	/usr/local/go/src/reflect/value.go:262 +0x85
reflect.flag.mustBeAssignable(...)
	/usr/local/go/src/reflect/value.go:249
reflect.Value.Set({0x12609e0?, 0xc005366db0?, 0x12609e0?}, {0x12609e0?, 0xc0031bc508?, 0x1f17ca0?})
	/usr/local/go/src/reflect/value.go:2084 +0x6a
github.com/go-pg/pg/v10/types.scanJSONValue({0x12609e0?, 0xc005366db0?, 0xc00b8f23b8?}, {0x1618b08?, 0xc01080a1e0}, 0x791)
	/go/pkg/mod/github.com/go-pg/pg/[email protected]/types/scan_value.go:254 +0x7a
github.com/go-pg/pg/v10/types.ScanValue({0x12609e0?, 0xc005366db0?, 0x13a0fc0?}, {0x1618b08, 0xc01080a1e0}, 0xc003c08340?)
	/go/pkg/mod/github.com/go-pg/pg/[email protected]/types/scan_value.go:177 +0x13a
github.com/go-pg/pg/v10/types.scanIfaceValue({0x1241bc0?, 0xc031f801b8?, 0x0?}, {0x1618b08, 0xc01080a1e0}, 0x4?)
	/go/pkg/mod/github.com/go-pg/pg/[email protected]/types/scan_value.go:167 +0xb2
github.com/go-pg/pg/v10/orm.(*Field).ScanValue(0xc002f5ec80, {0x132e1a0?, 0xc031f80000?, 0x4?}, {0x1618b08, 0xc01080a1e0}, 0x791)
	/go/pkg/mod/github.com/go-pg/pg/[email protected]/orm/field.go:125 +0xd4
github.com/go-pg/pg/v10/orm.(*structTableModel).scanColumn(0xc003b149c0, {0x3c01?, 0xc0?, {0xc02504c200?, 0xb?}}, {0x1618b08, 0xc01080a1e0}, 0x791)
	/go/pkg/mod/github.com/go-pg/pg/[email protected]/orm/model_table_struct.go:298 +0x189
@elliotcourant
Copy link
Collaborator

If this is still an active problem I can try to take a look at it this weekend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants