Skip to content
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

allow to set certain client-side capabilities #616

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

skoef
Copy link
Contributor

@skoef skoef commented Aug 23, 2021

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 code
  • CLIENT_NO_SCHEMA- flag has no client-side use
  • CLIENT_COMPRESS - this would imply the library should be able to handle compression, which it currently doesn't
  • CLIENT_ODBC - this flag was deprecated server side since MySQL 3.22
  • CLIENT_LOCAL_FILES - this would imply the libary would support loading local files into the server, which it currently doesn't
  • CLIENT_INTERACTIVE - has no function in the client-side code
  • CLIENT_SSL - already being handled elsewhere in the code
  • CLIENT_IGNORE_SIGPIPE - this is only relevant when using libmysqlclient
  • CLIENT_CONNECT_ATTRS - this would imply the library sends attributes during handshake, which it currently doesn't
  • CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS - not supported by the library at all
  • CLIENT_SESSION_TRACK - not supported by the library at all
  • CLIENT_DEPRECATE_EOF - not supported by the library at all

Client capabilities should be set during connecting as option function.

@skoef
Copy link
Contributor Author

skoef commented Aug 23, 2021

The new functions SetCapability and UnsetCapability are similar to the functions introduced in #593 for setting these capabilities on connections server-side.

@lance6716 lance6716 merged commit 403f48f into go-mysql-org:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants