@@ -14,6 +14,18 @@ import (
1414
1515const defaultAuthPluginName = mysql .AUTH_NATIVE_PASSWORD
1616
17+ var optionalCapabilities = []uint32 {
18+ mysql .CLIENT_FOUND_ROWS ,
19+ mysql .CLIENT_IGNORE_SPACE ,
20+ mysql .CLIENT_MULTI_STATEMENTS ,
21+ mysql .CLIENT_MULTI_RESULTS ,
22+ mysql .CLIENT_PS_MULTI_RESULTS ,
23+ mysql .CLIENT_CONNECT_ATTRS ,
24+ mysql .CLIENT_COMPRESS ,
25+ mysql .CLIENT_ZSTD_COMPRESSION_ALGORITHM ,
26+ mysql .CLIENT_LOCAL_FILES ,
27+ }
28+
1729// defines the supported auth plugins
1830var supportedAuthPlugins = []string {mysql .AUTH_NATIVE_PASSWORD , mysql .AUTH_SHA256_PASSWORD , mysql .AUTH_CACHING_SHA2_PASSWORD , mysql .AUTH_MARIADB_ED25519 }
1931
@@ -214,11 +226,9 @@ func (c *Conn) writeAuthHandshake() error {
214226 // Adjust client capability flags on specific client requests
215227 // Only flags that would make any sense setting and aren't handled elsewhere
216228 // in the library are supported here
217- capability |= c .ccaps & mysql .CLIENT_FOUND_ROWS | c .ccaps & mysql .CLIENT_IGNORE_SPACE |
218- c .ccaps & mysql .CLIENT_MULTI_STATEMENTS | c .ccaps & mysql .CLIENT_MULTI_RESULTS |
219- c .ccaps & mysql .CLIENT_PS_MULTI_RESULTS | c .ccaps & mysql .CLIENT_CONNECT_ATTRS |
220- c .ccaps & mysql .CLIENT_COMPRESS | c .ccaps & mysql .CLIENT_ZSTD_COMPRESSION_ALGORITHM |
221- c .ccaps & mysql .CLIENT_LOCAL_FILES
229+ for _ , optionalCap := range optionalCapabilities {
230+ capability |= c .ccaps & optionalCap
231+ }
222232
223233 capability &^= c .clientExplicitOffCaps
224234
0 commit comments