asyncer-io / r2dbc-mysql

Reactive Relational Database Connectivity for MySQL. The official successor to mirromutth/r2dbc-mysql(dev.miku:r2dbc-mysql).
https://r2dbc.io
Apache License 2.0
181 stars 18 forks source link

[feature] Add support for decoding session state info in Ok packets #227

Closed mirromutth closed 4 months ago

mirromutth commented 5 months ago

Is your feature request related to a problem? Please describe.

The OkMessage.parse currently does not attempt to decode session state informations, because it is not useful which at the time.

Currently, session state information of type SESSION_TRACK_SYSTEM_VARIABLES contains some potentially useful messages. e.g. auto_commit, transaction_isolation, or redirect_url (MariaDB only)

Describe the solution you'd like

  1. Make Capability.SESSION_TRACK available and disable it by default. Server will not respond session state info if it is disabled
  2. Add session state information decoding in OkMessage, other types except SESSION_TRACK_SYSTEM_VARIABLES remain ignored
  3. Add method Map<String, String> getSystemVariables() to OkMessage for getting value from the map of SESSION_TRACK_SYSTEM_VARIABLES

Additional context

See also MySQL docs and MariaDB docs, MariaDB redirect_url ticket