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 skipping unknown type when silent is true #251

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

tsg
Copy link
Contributor

@tsg tsg commented Dec 6, 2024

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.

@wwoytenko wwoytenko self-assigned this Dec 6, 2024
@wwoytenko wwoytenko added the bug Something isn't working label Dec 6, 2024
@wwoytenko wwoytenko self-requested a review December 6, 2024 20:48
Copy link
Contributor

@wwoytenko wwoytenko left a 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{
Copy link
Contributor

@wwoytenko wwoytenko Dec 6, 2024

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) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.

Str("Name", t.Name).
Int("Oid", int(t.Oid)).
Msg("cannot register array type for custom type")
continue
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops, sorry

Copy link
Contributor

@wwoytenko wwoytenko left a comment

Choose a reason for hiding this comment

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

LGTM

@wwoytenko wwoytenko merged commit fc27a6a into GreenmaskIO:main Dec 6, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants