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

Add support for MariaDB connection redirection #228

Open mirromutth opened 5 months ago

mirromutth commented 5 months ago

In the Ok packet of MariaDB, the session state information may contain redirect_url and the driver can keep the old connection, or redirect to the new URL.

Supporting redirection mechanism is helpful for proxy-based scenario. It is more like HTTP redirects or Oracle redirected connections. Clients get the servers’ address from proxies and connect to servers transparently without latency and computing resource wasted.

It is based on a common feature of MySQL and MariaDB, #227

See also https://jira.mariadb.org/browse/MDEV-15935 and https://mariadb.com/kb/en/ok_packet/#session_track_system_variables .