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

MySQL fork driver update #47159

Merged
merged 6 commits into from
Oct 4, 2024
Merged

MySQL fork driver update #47159

merged 6 commits into from
Oct 4, 2024

Conversation

greedy52
Copy link
Contributor

@greedy52 greedy52 commented Oct 3, 2024

@greedy52 greedy52 added the no-changelog Indicates that a PR does not require a changelog entry label Oct 3, 2024
}
endpoint := fmt.Sprintf("%s:%d", info.address, info.port)
conn, err := mysqlclient.Connect(endpoint, info.username, info.password, dbName, opt)
require.NoError(t, err)
t.Cleanup(func() {
_ = conn.Close()
_ = conn.Quit()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our old patch sends COM_QUIT in conn.Close. Now the driver provides a Quit function that does a similar thing so switching to Quit where I can.

@@ -464,17 +464,18 @@ func connectAsRDSMySQLAdmin(t *testing.T, ctx context.Context, instanceID string
const dbName = "mysql"
info := getRDSAdminInfo(t, ctx, instanceID)

opt := func(conn *mysqlclient.Conn) {
opt := func(conn *mysqlclient.Conn) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

driver now requires the option to return an error

@@ -108,6 +108,11 @@ func (c *clientConn) maxRoleLength() int {
return mysqlMaxUsernameLength
}

// Close calls conn.Quit to send COM_QUIT then close the conn.
func (c *clientConn) Close() error {
return trace.Wrap(c.Conn.Quit())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

clientConn will use Conn.Quit instead of Conn.Close. clientConn will be used for testing as well.

@greedy52 greedy52 marked this pull request as ready for review October 3, 2024 20:38
@github-actions github-actions bot added database-access Database access related issues and PRs size/sm labels Oct 3, 2024
lib/srv/db/mysql/test.go Outdated Show resolved Hide resolved
@greedy52 greedy52 added this pull request to the merge queue Oct 4, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 4, 2024
@greedy52 greedy52 added this pull request to the merge queue Oct 4, 2024
Merged via the queue into master with commit 7b0e857 Oct 4, 2024
42 checks passed
@greedy52 greedy52 deleted the STeve/mysql_driver_update branch October 4, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-access Database access related issues and PRs no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants