@@ -94,6 +94,41 @@ func (s *clientTestSuite) TestConn_Ping(c *C) {
94
94
c .Assert (err , IsNil )
95
95
}
96
96
97
+ func (s * clientTestSuite ) TestConn_SetCapability (c * C ) {
98
+ caps := []uint32 {
99
+ mysql .CLIENT_LONG_PASSWORD ,
100
+ mysql .CLIENT_FOUND_ROWS ,
101
+ mysql .CLIENT_LONG_FLAG ,
102
+ mysql .CLIENT_CONNECT_WITH_DB ,
103
+ mysql .CLIENT_NO_SCHEMA ,
104
+ mysql .CLIENT_COMPRESS ,
105
+ mysql .CLIENT_ODBC ,
106
+ mysql .CLIENT_LOCAL_FILES ,
107
+ mysql .CLIENT_IGNORE_SPACE ,
108
+ mysql .CLIENT_PROTOCOL_41 ,
109
+ mysql .CLIENT_INTERACTIVE ,
110
+ mysql .CLIENT_SSL ,
111
+ mysql .CLIENT_IGNORE_SIGPIPE ,
112
+ mysql .CLIENT_TRANSACTIONS ,
113
+ mysql .CLIENT_RESERVED ,
114
+ mysql .CLIENT_SECURE_CONNECTION ,
115
+ mysql .CLIENT_MULTI_STATEMENTS ,
116
+ mysql .CLIENT_MULTI_RESULTS ,
117
+ mysql .CLIENT_PS_MULTI_RESULTS ,
118
+ mysql .CLIENT_PLUGIN_AUTH ,
119
+ mysql .CLIENT_CONNECT_ATTRS ,
120
+ mysql .CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA ,
121
+ }
122
+
123
+ for _ , cap := range caps {
124
+ c .Assert (s .c .ccaps & cap > 0 , IsFalse )
125
+ s .c .SetCapability (cap )
126
+ c .Assert (s .c .ccaps & cap > 0 , IsTrue )
127
+ s .c .UnsetCapability (cap )
128
+ c .Assert (s .c .ccaps & cap > 0 , IsFalse )
129
+ }
130
+ }
131
+
97
132
// NOTE for MySQL 5.5 and 5.6, server side has to config SSL to pass the TLS test, otherwise, it will throw error that
98
133
// MySQL server does not support TLS required by the client. However, for MySQL 5.7 and above, auto generated certificates
99
134
// are used by default so that manual config is no longer necessary.
0 commit comments