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
195 stars 21 forks source link

Implement `Lifecycle` for `MySqlConnection` #171

Closed mirromutth closed 8 months ago

mirromutth commented 8 months ago

Motivation:

Implement Lifecycle for MySqlConnection. See also #64

Modification:

The MySqlConnection.

Result:

The MySqlConnection implements Lifecycle and will rollback in preRelease.

mirromutth commented 8 months ago

I re-implement it with COM_RESET_CONNECTION, which will reset all state, not just rollback transaction. That should make more sense.

mirromutth commented 8 months ago

Looks like MySQL 5.6.x and below does not support COM_RESET_CONNECTION.

Then I found that the reset status of COM_RESET_CONNECTION seemed a bit unexpected. It will clean up all prepared statements (server-preparing), which will leave our PrepareCache in an error state.

So I reset the commit, sorry for that.