-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
MySQL fork driver update #47159
Conversation
} | ||
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() |
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.
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 { |
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.
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()) |
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.
clientConn
will use Conn.Quit
instead of Conn.Close
. clientConn
will be used for testing as well.
Part of #43544
Fork branch: https://github.com/gravitational/go-mysql/tree/v1.9.1-teleport.2
Fork release: https://github.com/gravitational/go-mysql/releases/tag/v1.9.1-teleport.2
Dropped a few Teleport patches in the fork.