Skip to content

replication: add IsEmpty method to GTIDSet interface & implementations #1019

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

Merged
merged 1 commit into from
Mar 29, 2025

Conversation

wesleywright
Copy link
Contributor

Small quality of life improvement. For some use cases (such as writing tests), it is common to want to check if a given GTID set is empty or not. Currently this requires using Equal() with an empty GTID set (which takes a decent amount of boilerplate) or else requires inspecting the Set field (which is specific to a single concrete implementation of the GTIDSet interface).

This commits adds a simple IsEmpty() bool method to the GTIDSet interface for this use case, as well as implementations for both MysqlGTIDSet and MariadbGTIDSet.

@wesleywright
Copy link
Contributor Author

This is my first contribution to this repo; it seemed like a pretty small and straightforward change so I thought it was simplest to directly submit it as a PR. I'm happy to take any feedback on it :-)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@lance6716 lance6716 merged commit 639eccd into go-mysql-org:master Mar 29, 2025
15 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