elixir-ecto / myxql

MySQL 5.5+ driver for Elixir
Apache License 2.0
271 stars 66 forks source link

Filter client capabilities that can't be met by server #174

Closed greg-rychlewski closed 7 months ago

greg-rychlewski commented 10 months ago

Closes https://github.com/elixir-ecto/myxql/issues/173

Previously, during the initial handshake the library would error if the client and server capabilities didn't match. However, the MySQL spec says the client should simply remove the flags the server can't comply with: https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase.html.

It seems this part of the code was reusing a function that tried to ensure all the appropriate auth capabilities were present: https://github.com/elixir-ecto/myxql/blob/master/lib/myxql/protocol.ex#L116.

The change here is to introduce a filtering function instead of using the "ensure everything allowed" function.