allow to set certain client-side capabilities #616
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Besides the set of default capabilities and the one capability based on server support, with this PR it is also possible to set certain client flags as well during handshake. Only certain flags make sense, below is described why a wasn't added to the list:
CLIENT_CONNECT_WITH_DB
- already being handled elsewhere in the codeCLIENT_NO_SCHEMA
- flag has no client-side useCLIENT_COMPRESS
- this would imply the library should be able to handle compression, which it currently doesn'tCLIENT_ODBC
- this flag was deprecated server side since MySQL 3.22CLIENT_LOCAL_FILES
- this would imply the libary would support loading local files into the server, which it currently doesn'tCLIENT_INTERACTIVE
- has no function in the client-side codeCLIENT_SSL
- already being handled elsewhere in the codeCLIENT_IGNORE_SIGPIPE
- this is only relevant when using libmysqlclientCLIENT_CONNECT_ATTRS
- this would imply the library sends attributes during handshake, which it currently doesn'tCLIENT_CAN_HANDLE_EXPIRED_PASSWORDS
- not supported by the library at allCLIENT_SESSION_TRACK
- not supported by the library at allCLIENT_DEPRECATE_EOF
- not supported by the library at allClient capabilities should be set during connecting as option function.