-
Notifications
You must be signed in to change notification settings - Fork 22
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 skipping unknown type when silent is true #251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! Please fix the mentioned issue, and we’ll merge. Thanks!
Int("Oid", int(t.Oid)). | ||
Str("Kind", fmt.Sprintf("%c", t.Kind)). | ||
Msg("unable to register domain type") | ||
} | ||
continue | ||
} | ||
typeMap.RegisterType(&pgtype.Type{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add fix for Array type registering as well (it's below) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
pkg/toolkit/types.go
Outdated
Str("Name", t.Name). | ||
Int("Oid", int(t.Oid)). | ||
Msg("cannot register array type for custom type") | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like continue should be after if !silent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, sorry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I was trying Greenmask on a more complex DB (musicbrainz) and it was crashing in this code. It seems that the issue is that when silent is true, the type is not actually skipped.
I opened a PR directly in case it's this simple, but if you'd rather have me open an issue instead, I'm happy to.