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
184 stars 18 forks source link

Support recognition of MariaDB #176

Closed mirromutth closed 6 months ago

mirromutth commented 7 months ago

MariaDB contains more flags in the last 4 bytes of the 10 bytes filter (the reserved field) of HandshakeV10Request, which expands capabilities to 64 bits.

The CLIENT_MYSQL=1 flag is used to indicate whether to use the MySQL compatible protocol. MariaDB 10.2 and above will unset this flag. If this flag is unset, the server is assumed to be MariaDB.

Note that in the MySQL server, this flag is called LONG_PASSWORD, and it is not currently used by r2dbc-mysql. We can consider reinterpreting it for support MariaDB.

See also https://mariadb.com/kb/en/connection/#capabilities

mirromutth commented 6 months ago

Done in PR