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

Add test cases to gtid_test.go #634

Open
4 tasks
shunki-fujita opened this issue Jan 10, 2024 · 0 comments
Open
4 tasks

Add test cases to gtid_test.go #634

shunki-fujita opened this issue Jan 10, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@shunki-fujita
Copy link
Contributor

shunki-fujita commented Jan 10, 2024

What

moco/pkg/dbop/gtid.go

Lines 24 to 34 in 1338c63

// There are cases where Retrieved_Gtid_Set is empty,
// such as when there is no transaction immediately after a fail-over.
// Therefore, Retrieved_Gtid_Set and Executed_Gtid_Set are unioned to find for the top runner.
// The union of two GTID sets is simply their joined together with an interposed comma.
// https://dev.mysql.com/doc/refman/8.0/en/gtid-functions.html
var gtids string
if len(repl.RetrievedGtidSet) == 0 {
gtids = repl.ExecutedGtidSet
} else {
gtids = fmt.Sprintf("%s,%s", repl.RetrievedGtidSet, repl.ExecutedGtidSet)
}

No test exists when RetrievedGtidSet is empty.

How

Describe how to address the issue.

Checklist

  • Finish implementation of the issue
  • Test all functions
  • Have enough logs to trace activities
  • Notify developers of necessary actions
@shunki-fujita shunki-fujita added the good first issue Good for newcomers label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant