Skip to content

Commit d00dff7

Browse files
authored
server: set CLIENT_CONNECT_ATTRS (#975)
* server: set CLIENT_CONNECT_ATTRS * update comment/docs
1 parent 7dc8271 commit d00dff7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

server/conn.go

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ func (c *Conn) Charset() uint8 {
156156
return c.charset
157157
}
158158

159+
// Attributes returns the connection attributes.
160+
// Note that this is only sent to the server if CLIENT_CONNECT_ATTRS is set.
159161
func (c *Conn) Attributes() map[string]string {
160162
return c.attributes
161163
}

server/server_conf.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ func NewDefaultServer() *Server {
5151
serverVersion: "8.0.11",
5252
protocolVersion: 10,
5353
capability: CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_CONNECT_WITH_DB | CLIENT_PROTOCOL_41 |
54-
CLIENT_TRANSACTIONS | CLIENT_SECURE_CONNECTION | CLIENT_PLUGIN_AUTH | CLIENT_SSL | CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA,
54+
CLIENT_TRANSACTIONS | CLIENT_SECURE_CONNECTION | CLIENT_PLUGIN_AUTH | CLIENT_SSL |
55+
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | CLIENT_CONNECT_ATTRS,
5556
collationId: DEFAULT_COLLATION_ID,
5657
defaultAuthMethod: AUTH_NATIVE_PASSWORD,
5758
pubKey: getPublicKeyFromCert(certPem),

0 commit comments

Comments
 (0)